From 756f9595e751ea3dbaff5b37c69e4b14da50ae6f Mon Sep 17 00:00:00 2001 From: Arsh Date: Thu, 1 Feb 2024 21:49:11 +0000 Subject: [PATCH] [ci] format --- packages/astro/src/core/build/buildPipeline.ts | 6 +++--- packages/astro/test/middleware.test.js | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/astro/src/core/build/buildPipeline.ts b/packages/astro/src/core/build/buildPipeline.ts index ebbb4bba685f..60527b27f548 100644 --- a/packages/astro/src/core/build/buildPipeline.ts +++ b/packages/astro/src/core/build/buildPipeline.ts @@ -125,13 +125,13 @@ export class BuildPipeline extends Pipeline { const renderersEntryUrl = new URL(`renderers.mjs?time=${Date.now()}`, baseDirectory); const renderers = await import(renderersEntryUrl.toString()); - + const middleware = await import(new URL('middleware.mjs', baseDirectory).toString()) .then((mod) => mod.onRequest) // middleware.mjs is not emitted if there is no user middleware // in which case the import fails with ERR_MODULE_NOT_FOUND, and we fall back to a no-op middleware .catch(() => manifest.middleware); - + if (!renderers) { throw new Error( "Astro couldn't find the emitted renderers. This is an internal error, please file an issue." @@ -140,7 +140,7 @@ export class BuildPipeline extends Pipeline { return { ...manifest, renderers: renderers.renderers as SSRLoadedRenderer[], - middleware + middleware, }; } diff --git a/packages/astro/test/middleware.test.js b/packages/astro/test/middleware.test.js index 5f2153217ae8..736eac25c48e 100644 --- a/packages/astro/test/middleware.test.js +++ b/packages/astro/test/middleware.test.js @@ -279,9 +279,9 @@ describe('Middleware API in PROD mode, SSR', () => { }); it('can set locals for prerendered pages to use', async () => { - const text = await fixture.readFile("/client/prerendered/index.html") + const text = await fixture.readFile('/client/prerendered/index.html'); expect(text.includes('

yes they can!

')).to.be.true; - }) + }); // keep this last it('the integration should receive the path to the middleware', async () => {