diff options
author | 2023-10-16 14:10:41 +0000 | |
---|---|---|
committer | 2023-10-16 14:10:41 +0000 | |
commit | 3d1329414e507345b19e1dee81fe1bbff4eb3ae0 (patch) | |
tree | 69c822b1dc12f177b4919337109e6300a04df91d /packages/integrations/netlify/test/functions/edge-middleware.test.js | |
parent | 63977f5e438062b7e9302b8feff41b662bfa6231 (diff) | |
download | astro-3d1329414e507345b19e1dee81fe1bbff4eb3ae0.tar.gz astro-3d1329414e507345b19e1dee81fe1bbff4eb3ae0.tar.zst astro-3d1329414e507345b19e1dee81fe1bbff4eb3ae0.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 | 46 |
1 files changed, 29 insertions, 17 deletions
diff --git a/packages/integrations/netlify/test/functions/edge-middleware.test.js b/packages/integrations/netlify/test/functions/edge-middleware.test.js index 7e51b20da..90bcd69c7 100644 --- a/packages/integrations/netlify/test/functions/edge-middleware.test.js +++ b/packages/integrations/netlify/test/functions/edge-middleware.test.js @@ -1,20 +1,32 @@ -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; + }); }); |