Skip to content

Commit

Permalink
test(gatsby-plugin-fastify): implement testing (#97)
Browse files Browse the repository at this point in the history
* 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
moonmeister authored Oct 19, 2021
1 parent 82225fc commit 09bb2c2
Show file tree
Hide file tree
Showing 19 changed files with 596 additions and 32 deletions.
5 changes: 5 additions & 0 deletions .changeset/proud-ties-kneel.md
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.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"lint": "yarn prettier \"**/*.{js,ts,md,json,yml,json}\" --check",
"publish-ci": "yarn build && yarn changeset publish",
"postinstall": "yarn husky install",
"test": "yarn workspaces foreach -vp run test"
"test": "yarn workspaces foreach -vp run pretest && yarn workspaces foreach -vp run test"
},
"devDependencies": {
"@changesets/changelog-github": "^0.4.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby-plugin-fastify/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

- Serving Gatsby Functions
- Serving static files
- 404 page middleware
- Gatsby 404 page
- Gatsby redirects
- Client-side paths
- Serving the site with pathPrefix - set it up inside `gatsby-config.js`, the plugin will take care of it
Expand Down
19 changes: 19 additions & 0 deletions packages/gatsby-plugin-fastify/jest.config.js
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`,
};
8 changes: 7 additions & 1 deletion packages/gatsby-plugin-fastify/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
},
"scripts": {
"build": "babel src --out-dir . --ignore \"**/__tests__,**/*.d.ts\" --extensions \".ts,.js\"",
"pretest": "cd test-site && yarn run build",
"test": "jest --coverage",
"test:watch": "jest --watch",
"watch": "yarn build --watch"
},
"dependencies": {
Expand All @@ -39,15 +42,18 @@
"@babel/cli": "^7.15.7",
"@babel/core": "^7.15.8",
"@types/fs-extra": "^9.0.13",
"@types/jest": "^27.0.2",
"@types/node": "^14.17.21",
"babel-jest": "^27.2.5",
"babel-preset-gatsby-package": "^1.14.0",
"cross-env": "^7.0.3",
"fastify": "^3.22.0",
"fastify-compress": "^3.6.0",
"fastify-plugin": "^3.0.0",
"fastify-static": "^4.4.0",
"gatsby": "^3.14.2",
"gatsby-plugin-utils": "^1.14.0"
"gatsby-plugin-utils": "^1.14.0",
"jest": "^27.2.5"
},
"peerDependencies": {
"fastify": "^3.19.0",
Expand Down
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>
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>
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>
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 packages/gatsby-plugin-fastify/src/__tests__/gatsby-node.js
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();
});
});
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>"
`;
Loading

0 comments on commit 09bb2c2

Please sign in to comment.