diff options
Diffstat (limited to 'packages/integrations/netlify/test/functions/404.test.js')
-rw-r--r-- | packages/integrations/netlify/test/functions/404.test.js | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/packages/integrations/netlify/test/functions/404.test.js b/packages/integrations/netlify/test/functions/404.test.js index 1782507db..a1f792ce0 100644 --- a/packages/integrations/netlify/test/functions/404.test.js +++ b/packages/integrations/netlify/test/functions/404.test.js @@ -1,19 +1,21 @@ -import { expect } from 'chai'; -import fs from 'fs/promises'; -import { cli } from './test-utils.js'; -import { fileURLToPath } from 'url'; +import { expect } from "chai"; +import fs from "fs/promises"; +import { cli } from "./test-utils.js"; +import { fileURLToPath } from "url"; -const root = new URL('./fixtures/404/', import.meta.url).toString(); +const root = new URL("./fixtures/404/", import.meta.url).toString(); -describe('404 page', () => { +describe("404 page", () => { + before(async () => { + await cli("build", "--root", fileURLToPath(root)); + }); - before(async () => { - await cli('build', '--root', fileURLToPath(root)); - }); - - it('404 route is included in the redirect file', async () => { - const redir = await fs.readFile(new URL('./dist/_redirects', root), 'utf-8'); - const expr = new RegExp('/* /.netlify/functions/entry 404'); - expect(redir).to.match(expr); - }); + it("404 route is included in the redirect file", async () => { + const redir = await fs.readFile( + new URL("./dist/_redirects", root), + "utf-8", + ); + const expr = new RegExp("/* /.netlify/functions/entry 404"); + expect(redir).to.match(expr); + }); }); |