diff options
author | 2023-10-16 14:26:36 +0000 | |
---|---|---|
committer | 2023-10-16 14:26:36 +0000 | |
commit | 31863b80230cb61390b5cc218c603090b299f204 (patch) | |
tree | a05d6a6137101017ed60e144093921883d67a1fc /packages/integrations/netlify/test/functions/edge-middleware.test.js | |
parent | 3d1329414e507345b19e1dee81fe1bbff4eb3ae0 (diff) | |
download | astro-31863b80230cb61390b5cc218c603090b299f204.tar.gz astro-31863b80230cb61390b5cc218c603090b299f204.tar.zst astro-31863b80230cb61390b5cc218c603090b299f204.zip |
[ci] format
Diffstat (limited to 'packages/integrations/netlify/test/functions/edge-middleware.test.js')
-rw-r--r-- | packages/integrations/netlify/test/functions/edge-middleware.test.js | 52 |
1 files changed, 23 insertions, 29 deletions
diff --git a/packages/integrations/netlify/test/functions/edge-middleware.test.js b/packages/integrations/netlify/test/functions/edge-middleware.test.js index 90bcd69c7..ea214f82a 100644 --- a/packages/integrations/netlify/test/functions/edge-middleware.test.js +++ b/packages/integrations/netlify/test/functions/edge-middleware.test.js @@ -1,32 +1,26 @@ -import { fileURLToPath } from "url"; -import { cli } from "./test-utils.js"; -import fs from "fs/promises"; -import { expect } from "chai"; +import { fileURLToPath } from 'url'; +import { cli } from './test-utils.js'; +import fs from 'fs/promises'; +import { expect } from 'chai'; -describe("Middleware", () => { - it("with edge handle file, should successfully build the middleware", async () => { - const root = new URL( - "./fixtures/middleware-with-handler-file/", - import.meta.url, - ).toString(); - await cli("build", "--root", fileURLToPath(root)); - const contents = await fs.readFile( - new URL("./.netlify/edge-functions/edgeMiddleware.js", root), - "utf-8", - ); - expect(contents.includes('"Hello world"')).to.be.true; - }); +describe('Middleware', () => { + it('with edge handle file, should successfully build the middleware', async () => { + const root = new URL('./fixtures/middleware-with-handler-file/', import.meta.url).toString(); + await cli('build', '--root', fileURLToPath(root)); + const contents = await fs.readFile( + new URL('./.netlify/edge-functions/edgeMiddleware.js', root), + 'utf-8' + ); + expect(contents.includes('"Hello world"')).to.be.true; + }); - it("without edge handle file, should successfully build the middleware", async () => { - const root = new URL( - "./fixtures/middleware-without-handler-file/", - import.meta.url, - ).toString(); - await cli("build", "--root", fileURLToPath(root)); - const contents = await fs.readFile( - new URL("./.netlify/edge-functions/edgeMiddleware.js", root), - "utf-8", - ); - expect(contents.includes('"Hello world"')).to.be.false; - }); + it('without edge handle file, should successfully build the middleware', async () => { + const root = new URL('./fixtures/middleware-without-handler-file/', import.meta.url).toString(); + await cli('build', '--root', fileURLToPath(root)); + const contents = await fs.readFile( + new URL('./.netlify/edge-functions/edgeMiddleware.js', root), + 'utf-8' + ); + expect(contents.includes('"Hello world"')).to.be.false; + }); }); |