-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(gatsby-plugin-fastify): implement testing (#97)
* initial testing setup * Docs/types * test: implement initial tests, fix path resolution in clientPaths, add splat route for testing * fix: add pretest to package and execute * silence logs * remove console.log from testing * test: add test for path prefix * test: write tests for gatsby-node * add coverage log on test run * chore: and changeset * fix: better mocks so things aren't fragile and reading from the FS. * fix: some snap shot issues
- Loading branch information
1 parent
82225fc
commit 09bb2c2
Showing
19 changed files
with
596 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"gatsby-plugin-fastify": minor | ||
--- | ||
|
||
Implemented testing and that came with some minor changes and fixes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// For a detailed explanation regarding each configuration property, visit: | ||
// https://jestjs.io/docs/en/configuration.html | ||
|
||
module.exports = { | ||
// Automatically clear mock calls and instances between every test | ||
clearMocks: true, | ||
|
||
// A set of global variables that need to be available in all test environments | ||
globals: { | ||
__PATH_PREFIX__: ``, | ||
}, | ||
|
||
// An array of directory names to be searched recursively up from the requiring module's location | ||
moduleDirectories: [`node_modules`], | ||
|
||
modulePathIgnorePatterns: [`<rootDir>/test-site/`], | ||
// The test environment that will be used for testing | ||
testEnvironment: `node`, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
packages/gatsby-plugin-fastify/src/__tests__/__files__/public/404.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Gatsby Plugin Fastify</title> | ||
</head> | ||
|
||
<body> | ||
<h1>Page Not Found</h1> | ||
</body> | ||
|
||
</html> |
14 changes: 14 additions & 0 deletions
14
packages/gatsby-plugin-fastify/src/__tests__/__files__/public/app/[...]/index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Gatsby Plugin Fastify - Client Side Route</title> | ||
</head> | ||
|
||
<body> | ||
<h1>Welcome to the CSR!</h1> | ||
</body> | ||
|
||
</html> |
14 changes: 14 additions & 0 deletions
14
packages/gatsby-plugin-fastify/src/__tests__/__files__/public/index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Gatsby Plugin Fastify</title> | ||
</head> | ||
|
||
<body> | ||
<h1>Hello World</h1> | ||
</body> | ||
|
||
</html> |
56 changes: 56 additions & 0 deletions
56
packages/gatsby-plugin-fastify/src/__tests__/__snapshots__/gatsby-node.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Gatsby Node API Should Build Config 1`] = ` | ||
Object { | ||
"clientSideRoutes": Array [ | ||
Object { | ||
"matchPath": "/app/*", | ||
"path": "/app/[...]/", | ||
}, | ||
], | ||
"fakeOption": "fakeValue", | ||
"functions": Array [ | ||
Object { | ||
"absoluteCompiledFilePath": "/Users/user/code/gatsby-uc/plugins/packages/gatsby-plugin-fastify/test-site/.cache/functions/splat/:splat.js", | ||
"functionRoute": "splat/:splat", | ||
"originalAbsoluteFilePath": "/Users/user/code/gatsby-uc/plugins/packages/gatsby-plugin-fastify/test-site/src/api/splat/:splat.js", | ||
"originalRelativeFilePath": "splat/:splat.js", | ||
"pluginName": "default-site-plugin", | ||
"relativeCompiledFilePath": "splat/:splat.js", | ||
}, | ||
Object { | ||
"absoluteCompiledFilePath": "/Users/user/code/gatsby-uc/plugins/packages/gatsby-plugin-fastify/test-site/.cache/functions/test.js", | ||
"functionRoute": "test", | ||
"originalAbsoluteFilePath": "/Users/user/code/gatsby-uc/plugins/packages/gatsby-plugin-fastify/test-site/src/api/test.js", | ||
"originalRelativeFilePath": "test.js", | ||
"pluginName": "default-site-plugin", | ||
"relativeCompiledFilePath": "test.js", | ||
}, | ||
], | ||
"prefix": "/test", | ||
"redirects": Array [ | ||
Object { | ||
"fromPath": "/perm-redirect", | ||
"ignoreCase": true, | ||
"isPermanent": true, | ||
"redirectInBrowser": false, | ||
"toPath": "/posts/page-1", | ||
}, | ||
Object { | ||
"fromPath": "/temp-redirect", | ||
"ignoreCase": true, | ||
"isPermanent": false, | ||
"redirectInBrowser": false, | ||
"toPath": "/posts/page-2", | ||
}, | ||
Object { | ||
"fromPath": "/alt-redirect", | ||
"ignoreCase": true, | ||
"isPermanent": false, | ||
"redirectInBrowser": false, | ||
"statusCode": 307, | ||
"toPath": "/posts/page-3", | ||
}, | ||
], | ||
} | ||
`; |
113 changes: 113 additions & 0 deletions
113
packages/gatsby-plugin-fastify/src/__tests__/gatsby-node.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
const { onPostBuild } = require("../gatsby-node"); | ||
const fs = require("fs-extra"); | ||
|
||
jest.mock("../../utils/constants", () => ({ | ||
...jest.requireActual("../utils/constants"), | ||
PATH_TO_FUNCTIONS: "test-site/.cache/functions/", | ||
PATH_TO_PUBLIC: __dirname + "/__files__/public/", | ||
PATH_TO_CACHE: "test-site/.cache/", | ||
CONFIG_FILE_PATH: __dirname + "../../../test-site/.cache/", | ||
})); | ||
|
||
jest.mock("fs-extra", () => ({ | ||
existsSync: jest.fn((path) => { | ||
if (path.includes(".cache/functions")) { | ||
return true; | ||
} | ||
return false; | ||
}), | ||
mkdir: jest.fn(), | ||
writeJSON: jest.fn(), | ||
readJSON: jest.fn((path) => { | ||
if (path.includes("manifest.json")) { | ||
return [ | ||
{ | ||
functionRoute: "splat/:splat", | ||
pluginName: "default-site-plugin", | ||
originalAbsoluteFilePath: | ||
"/Users/user/code/gatsby-uc/plugins/packages/gatsby-plugin-fastify/test-site/src/api/splat/:splat.js", | ||
originalRelativeFilePath: "splat/:splat.js", | ||
relativeCompiledFilePath: "splat/:splat.js", | ||
absoluteCompiledFilePath: | ||
"/Users/user/code/gatsby-uc/plugins/packages/gatsby-plugin-fastify/test-site/.cache/functions/splat/:splat.js", | ||
}, | ||
{ | ||
functionRoute: "test", | ||
pluginName: "default-site-plugin", | ||
originalAbsoluteFilePath: | ||
"/Users/user/code/gatsby-uc/plugins/packages/gatsby-plugin-fastify/test-site/src/api/test.js", | ||
originalRelativeFilePath: "test.js", | ||
relativeCompiledFilePath: "test.js", | ||
absoluteCompiledFilePath: | ||
"/Users/user/code/gatsby-uc/plugins/packages/gatsby-plugin-fastify/test-site/.cache/functions/test.js", | ||
}, | ||
]; | ||
} else { | ||
throw new Error("Invalid path"); | ||
} | ||
}), | ||
})); | ||
|
||
const pathPrefix = "/test"; | ||
const store = { | ||
getState: jest.fn(() => ({ | ||
program: { | ||
directory: __dirname + "/__files__/", | ||
}, | ||
pages: [ | ||
{ | ||
fakePage: "fakeValue", | ||
path: "/", | ||
}, | ||
{ | ||
matchPath: "/app/*", | ||
path: "/app/[...]/", | ||
}, | ||
], | ||
redirects: [ | ||
{ | ||
fromPath: "/perm-redirect", | ||
isPermanent: true, | ||
ignoreCase: true, | ||
redirectInBrowser: false, | ||
toPath: "/posts/page-1", | ||
}, | ||
{ | ||
fromPath: "/temp-redirect", | ||
isPermanent: false, | ||
ignoreCase: true, | ||
redirectInBrowser: false, | ||
toPath: "/posts/page-2", | ||
}, | ||
{ | ||
fromPath: "/alt-redirect", | ||
isPermanent: false, | ||
ignoreCase: true, | ||
redirectInBrowser: false, | ||
toPath: "/posts/page-3", | ||
statusCode: 307, | ||
}, | ||
], | ||
})), | ||
}; | ||
|
||
const reporter = { | ||
error: jest.fn((_message, e) => { | ||
throw new Error(e); | ||
}), | ||
}; | ||
|
||
const pluginOptions = { | ||
fakeOption: "fakeValue", | ||
}; | ||
|
||
describe(`Gatsby Node API`, () => { | ||
it(`Should Build Config`, async () => { | ||
await onPostBuild({ store, reporter, pathPrefix }, pluginOptions); | ||
|
||
const writeJSONCall = fs.writeJSON.mock.calls[0]; | ||
expect(fs.writeJSON).toHaveBeenCalledTimes(1); | ||
expect(writeJSONCall[0]).toContain(".cache/gatsby-plugin-fastify.json"); | ||
expect(writeJSONCall[1]).toMatchSnapshot(); | ||
}); | ||
}); |
92 changes: 92 additions & 0 deletions
92
packages/gatsby-plugin-fastify/src/__tests__/plugins/__snapshots__/gatsby.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Test Gatsby Server Client Side Routes Should handle base route 1`] = ` | ||
"<!DOCTYPE html> | ||
<html lang=\\"en\\"> | ||
<head> | ||
<meta charset=\\"utf-8\\"> | ||
<meta name=\\"viewport\\" content=\\"width=device-width, initial-scale=1.0\\"> | ||
<title>Gatsby Plugin Fastify - Client Side Route</title> | ||
</head> | ||
<body> | ||
<h1>Welcome to the CSR!</h1> | ||
</body> | ||
</html>" | ||
`; | ||
exports[`Test Gatsby Server Client Side Routes Should handle sub routes 1`] = ` | ||
"<!DOCTYPE html> | ||
<html lang=\\"en\\"> | ||
<head> | ||
<meta charset=\\"utf-8\\"> | ||
<meta name=\\"viewport\\" content=\\"width=device-width, initial-scale=1.0\\"> | ||
<title>Gatsby Plugin Fastify - Client Side Route</title> | ||
</head> | ||
<body> | ||
<h1>Welcome to the CSR!</h1> | ||
</body> | ||
</html>" | ||
`; | ||
exports[`Test Gatsby Server Gatsby Functions Should 404 on bad function route 1`] = `"Function not found."`; | ||
exports[`Test Gatsby Server Gatsby Functions Should serve function route 1`] = `"[{\\"_id\\":\\"612d652f43f0c05240ed09b1\\",\\"index\\":0,\\"guid\\":\\"ced90cbd-3fad-4c66-bd8d-678eebb3f319\\",\\"isActive\\":true,\\"balance\\":\\"$3,289.14\\",\\"picture\\":\\"http://placehold.it/32x32\\",\\"age\\":34,\\"eyeColor\\":\\"blue\\",\\"name\\":\\"Mcclure Cohen\\",\\"gender\\":\\"male\\",\\"company\\":\\"ONTALITY\\",\\"email\\":\\"mcclurecohen@ontality.com\\",\\"phone\\":\\"+1 (876) 555-3658\\",\\"address\\":\\"933 Conklin Avenue, Joes, Indiana, 9109\\",\\"about\\":\\"Do labore fugiat exercitation esse commodo dolor voluptate proident ullamco mollit eu. Dolor aliqua incididunt ex consectetur qui labore in laborum dolore mollit fugiat. Occaecat nisi ea nulla deserunt dolore aliqua consequat ipsum fugiat aliqua est sunt anim cillum. Nulla culpa dolore reprehenderit quis aliquip.\\\\r\\\\n\\",\\"registered\\":\\"2016-03-02T03:01:11 +08:00\\",\\"latitude\\":-13.438572,\\"longitude\\":116.414307,\\"tags\\":[\\"Lorem\\",\\"dolore\\",\\"anim\\",\\"mollit\\",\\"ullamco\\",\\"magna\\",\\"elit\\"],\\"friends\\":[{\\"id\\":0,\\"name\\":\\"Burnett Farley\\"},{\\"id\\":1,\\"name\\":\\"Glenn Osborn\\"},{\\"id\\":2,\\"name\\":\\"Berry Schwartz\\"}],\\"greeting\\":\\"Hello, Mcclure Cohen! You have 7 unread messages.\\",\\"favoriteFruit\\":\\"banana\\"},{\\"_id\\":\\"612d652f366d8330fa996824\\",\\"index\\":1,\\"guid\\":\\"7101122e-8cea-4a02-b1b8-ae910c0802af\\",\\"isActive\\":false,\\"balance\\":\\"$3,387.50\\",\\"picture\\":\\"http://placehold.it/32x32\\",\\"age\\":32,\\"eyeColor\\":\\"blue\\",\\"name\\":\\"Geneva Valdez\\",\\"gender\\":\\"female\\",\\"company\\":\\"LIQUICOM\\",\\"email\\":\\"genevavaldez@liquicom.com\\",\\"phone\\":\\"+1 (974) 495-2314\\",\\"address\\":\\"615 Waldorf Court, Belleview, New Jersey, 4579\\",\\"about\\":\\"Sint anim sunt enim ea ea exercitation officia adipisicing aute. Cillum aliquip dolor mollit sunt sint. Sint excepteur sit ut eu culpa aute voluptate est non est sint do nostrud ut. Nostrud officia amet consectetur exercitation aliquip nulla occaecat. Irure voluptate aute irure quis aute ipsum.\\\\r\\\\n\\",\\"registered\\":\\"2019-10-23T07:06:59 +07:00\\",\\"latitude\\":4.157784,\\"longitude\\":79.800439,\\"tags\\":[\\"Lorem\\",\\"enim\\",\\"sint\\",\\"commodo\\",\\"minim\\",\\"tempor\\",\\"consectetur\\"],\\"friends\\":[{\\"id\\":0,\\"name\\":\\"Teri Crane\\"},{\\"id\\":1,\\"name\\":\\"Colleen Burns\\"},{\\"id\\":2,\\"name\\":\\"Pierce Stafford\\"}],\\"greeting\\":\\"Hello, Geneva Valdez! You have 5 unread messages.\\",\\"favoriteFruit\\":\\"banana\\"},{\\"_id\\":\\"612d652fac8efd8e645f7305\\",\\"index\\":2,\\"guid\\":\\"9e49d2b8-2684-4a2b-8d34-2db63470105e\\",\\"isActive\\":true,\\"balance\\":\\"$1,648.73\\",\\"picture\\":\\"http://placehold.it/32x32\\",\\"age\\":39,\\"eyeColor\\":\\"green\\",\\"name\\":\\"Beth Pitts\\",\\"gender\\":\\"female\\",\\"company\\":\\"QUIZKA\\",\\"email\\":\\"bethpitts@quizka.com\\",\\"phone\\":\\"+1 (967) 452-3934\\",\\"address\\":\\"209 Elm Avenue, Soham, South Dakota, 6752\\",\\"about\\":\\"Excepteur est et cupidatat id nisi quis occaecat est non cillum. Dolore aliquip elit aliquip exercitation anim ad aliqua sint enim mollit anim. Nulla veniam amet labore consectetur nulla non culpa laboris non ea. Irure fugiat fugiat reprehenderit aute labore. Commodo enim velit sit sunt in eu adipisicing proident aliqua sit officia. Et cupidatat mollit est voluptate adipisicing ullamco ullamco. Elit in sint velit laboris fugiat.\\\\r\\\\n\\",\\"registered\\":\\"2018-07-10T08:23:13 +07:00\\",\\"latitude\\":-41.232792,\\"longitude\\":14.620843,\\"tags\\":[\\"ipsum\\",\\"voluptate\\",\\"reprehenderit\\",\\"fugiat\\",\\"nulla\\",\\"elit\\",\\"dolore\\"],\\"friends\\":[{\\"id\\":0,\\"name\\":\\"Rosa Case\\"},{\\"id\\":1,\\"name\\":\\"Charlene Wilkinson\\"},{\\"id\\":2,\\"name\\":\\"Wilcox Shannon\\"}],\\"greeting\\":\\"Hello, Beth Pitts! You have 4 unread messages.\\",\\"favoriteFruit\\":\\"apple\\"},{\\"_id\\":\\"612d652f86b888292e0537ea\\",\\"index\\":3,\\"guid\\":\\"ae58b78c-46a4-4a09-b636-d86ebc84870c\\",\\"isActive\\":false,\\"balance\\":\\"$1,820.92\\",\\"picture\\":\\"http://placehold.it/32x32\\",\\"age\\":38,\\"eyeColor\\":\\"blue\\",\\"name\\":\\"Mack Parker\\",\\"gender\\":\\"male\\",\\"company\\":\\"GRONK\\",\\"email\\":\\"mackparker@gronk.com\\",\\"phone\\":\\"+1 (942) 455-3698\\",\\"address\\":\\"340 Village Court, Spokane, Iowa, 7827\\",\\"about\\":\\"Officia occaecat eu duis officia amet in ea ad mollit ut. Mollit non anim ex do. In esse commodo esse ullamco irure laborum officia enim deserunt et. Ut adipisicing aliqua qui anim fugiat duis magna culpa aliqua nisi ex tempor Lorem cupidatat. Aute Lorem ut fugiat reprehenderit fugiat velit. Eu occaecat esse sit anim ad.\\\\r\\\\n\\",\\"registered\\":\\"2017-10-26T05:06:57 +07:00\\",\\"latitude\\":62.176215,\\"longitude\\":50.081649,\\"tags\\":[\\"eiusmod\\",\\"esse\\",\\"adipisicing\\",\\"deserunt\\",\\"minim\\",\\"dolor\\",\\"sint\\"],\\"friends\\":[{\\"id\\":0,\\"name\\":\\"Corinne Cleveland\\"},{\\"id\\":1,\\"name\\":\\"Janell Stevenson\\"},{\\"id\\":2,\\"name\\":\\"Ruiz Dalton\\"}],\\"greeting\\":\\"Hello, Mack Parker! You have 5 unread messages.\\",\\"favoriteFruit\\":\\"banana\\"},{\\"_id\\":\\"612d652f918c5464a5d1badc\\",\\"index\\":4,\\"guid\\":\\"16de477f-8260-4dbf-803a-0b9af672a7a3\\",\\"isActive\\":false,\\"balance\\":\\"$2,015.74\\",\\"picture\\":\\"http://placehold.it/32x32\\",\\"age\\":40,\\"eyeColor\\":\\"brown\\",\\"name\\":\\"Benton Garza\\",\\"gender\\":\\"male\\",\\"company\\":\\"CODACT\\",\\"email\\":\\"bentongarza@codact.com\\",\\"phone\\":\\"+1 (978) 544-3959\\",\\"address\\":\\"723 Linden Street, Loma, Hawaii, 2183\\",\\"about\\":\\"Veniam voluptate eiusmod est exercitation magna dolor cillum veniam. Anim culpa veniam adipisicing consequat sint adipisicing. Minim velit eu tempor enim nulla enim adipisicing id elit irure ex. Voluptate duis cupidatat fugiat amet dolore veniam. Adipisicing ad occaecat velit cillum.\\\\r\\\\n\\",\\"registered\\":\\"2016-05-12T08:32:44 +07:00\\",\\"latitude\\":41.639383,\\"longitude\\":-33.102296,\\"tags\\":[\\"excepteur\\",\\"et\\",\\"duis\\",\\"velit\\",\\"laboris\\",\\"pariatur\\",\\"dolor\\"],\\"friends\\":[{\\"id\\":0,\\"name\\":\\"Ryan Waters\\"},{\\"id\\":1,\\"name\\":\\"Robbie Rosario\\"},{\\"id\\":2,\\"name\\":\\"Gracie Freeman\\"}],\\"greeting\\":\\"Hello, Benton Garza! You have 1 unread messages.\\",\\"favoriteFruit\\":\\"strawberry\\"},{\\"_id\\":\\"612d652f1dd2eb98a16e0a3d\\",\\"index\\":5,\\"guid\\":\\"856875e2-24fa-426c-a1cd-5447ea2abeb9\\",\\"isActive\\":false,\\"balance\\":\\"$1,889.99\\",\\"picture\\":\\"http://placehold.it/32x32\\",\\"age\\":37,\\"eyeColor\\":\\"brown\\",\\"name\\":\\"Tommie Durham\\",\\"gender\\":\\"female\\",\\"company\\":\\"EVIDENDS\\",\\"email\\":\\"tommiedurham@evidends.com\\",\\"phone\\":\\"+1 (866) 570-3407\\",\\"address\\":\\"694 Barlow Drive, Lithium, Tennessee, 1100\\",\\"about\\":\\"Enim nostrud ea ea quis. Commodo commodo reprehenderit ea minim officia enim. Velit laboris incididunt commodo esse commodo ea excepteur in deserunt deserunt. Fugiat ad exercitation aliqua minim ea sunt pariatur est commodo sunt nisi ex. Ipsum ad enim ut et culpa pariatur.\\\\r\\\\n\\",\\"registered\\":\\"2018-03-01T06:21:31 +08:00\\",\\"latitude\\":52.298302,\\"longitude\\":-22.076203,\\"tags\\":[\\"laboris\\",\\"labore\\",\\"officia\\",\\"in\\",\\"est\\",\\"deserunt\\",\\"ad\\"],\\"friends\\":[{\\"id\\":0,\\"name\\":\\"Francis Park\\"},{\\"id\\":1,\\"name\\":\\"Schmidt Williamson\\"},{\\"id\\":2,\\"name\\":\\"Adkins Shields\\"}],\\"greeting\\":\\"Hello, Tommie Durham! You have 6 unread messages.\\",\\"favoriteFruit\\":\\"apple\\"},{\\"_id\\":\\"612d652f8e1b1bc30f3585ec\\",\\"index\\":6,\\"guid\\":\\"eb70d15e-fee8-4e76-8c90-049d3d6dac43\\",\\"isActive\\":false,\\"balance\\":\\"$1,139.14\\",\\"picture\\":\\"http://placehold.it/32x32\\",\\"age\\":21,\\"eyeColor\\":\\"brown\\",\\"name\\":\\"Lee Good\\",\\"gender\\":\\"male\\",\\"company\\":\\"LIMAGE\\",\\"email\\":\\"leegood@limage.com\\",\\"phone\\":\\"+1 (945) 414-3105\\",\\"address\\":\\"652 Hendrickson Street, Wilsonia, Arizona, 9156\\",\\"about\\":\\"Amet ullamco adipisicing velit cillum quis minim nulla sint dolor. Labore magna quis nulla occaecat cupidatat anim irure. Anim duis nisi ipsum sint.\\\\r\\\\n\\",\\"registered\\":\\"2017-10-14T04:22:31 +07:00\\",\\"latitude\\":85.591186,\\"longitude\\":51.21934,\\"tags\\":[\\"ipsum\\",\\"ad\\",\\"exercitation\\",\\"mollit\\",\\"magna\\",\\"irure\\",\\"elit\\"],\\"friends\\":[{\\"id\\":0,\\"name\\":\\"Delacruz Vaughn\\"},{\\"id\\":1,\\"name\\":\\"Kari Figueroa\\"},{\\"id\\":2,\\"name\\":\\"Kris Marsh\\"}],\\"greeting\\":\\"Hello, Lee Good! You have 7 unread messages.\\",\\"favoriteFruit\\":\\"strawberry\\"}]"`; | ||
exports[`Test Gatsby Server Gatsby Functions Should serve function splat route 1`] = `"{\\"splat\\":\\"doesThisWork\\"}"`; | ||
exports[`Test Gatsby Server Gatsby Path Prefix Should be served at prefix 1`] = ` | ||
"<!DOCTYPE html> | ||
<html lang=\\"en\\"> | ||
<head> | ||
<meta charset=\\"utf-8\\"> | ||
<meta name=\\"viewport\\" content=\\"width=device-width, initial-scale=1.0\\"> | ||
<title>Gatsby Plugin Fastify</title> | ||
</head> | ||
<body> | ||
<h1>Hello World</h1> | ||
</body> | ||
</html>" | ||
`; | ||
exports[`Test Gatsby Server Gatsby Static Routes Should serve custom 404 1`] = ` | ||
"<!DOCTYPE html> | ||
<html lang=\\"en\\"> | ||
<head> | ||
<meta charset=\\"utf-8\\"> | ||
<meta name=\\"viewport\\" content=\\"width=device-width, initial-scale=1.0\\"> | ||
<title>Gatsby Plugin Fastify</title> | ||
</head> | ||
<body> | ||
<h1>Page Not Found</h1> | ||
</body> | ||
</html>" | ||
`; | ||
exports[`Test Gatsby Server Gatsby Static Routes Should serve static index route 1`] = ` | ||
"<!DOCTYPE html> | ||
<html lang=\\"en\\"> | ||
<head> | ||
<meta charset=\\"utf-8\\"> | ||
<meta name=\\"viewport\\" content=\\"width=device-width, initial-scale=1.0\\"> | ||
<title>Gatsby Plugin Fastify</title> | ||
</head> | ||
<body> | ||
<h1>Hello World</h1> | ||
</body> | ||
</html>" | ||
`; |
Oops, something went wrong.