From 6916e5c79fb21310634d65897d3ae9990bae6af4 Mon Sep 17 00:00:00 2001 From: matthewp Date: Wed, 3 May 2023 15:28:00 +0000 Subject: [PATCH] [ci] format --- .../astro/src/vite-plugin-astro-server/response.ts | 2 +- packages/astro/test/ssr-api-route.test.js | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/astro/src/vite-plugin-astro-server/response.ts b/packages/astro/src/vite-plugin-astro-server/response.ts index e2f38beb7..b1ac9d3cd 100644 --- a/packages/astro/src/vite-plugin-astro-server/response.ts +++ b/packages/astro/src/vite-plugin-astro-server/response.ts @@ -57,7 +57,7 @@ export async function writeWebResponse(res: http.ServerResponse, webResponse: Re // Attach any set-cookie headers added via Astro.cookies.set() const setCookieHeaders = Array.from(getSetCookiesFromResponse(webResponse)); - if(setCookieHeaders.length) { + if (setCookieHeaders.length) { // Always use `res.setHeader` because headers.append causes them to be concatenated. res.setHeader('set-cookie', setCookieHeaders); } diff --git a/packages/astro/test/ssr-api-route.test.js b/packages/astro/test/ssr-api-route.test.js index 419282b5a..1d8f012a6 100644 --- a/packages/astro/test/ssr-api-route.test.js +++ b/packages/astro/test/ssr-api-route.test.js @@ -96,7 +96,7 @@ describe('API routes in SSR', () => { }); it('Can set multiple headers of the same type', async () => { - const response = await new Promise(resolve => { + const response = await new Promise((resolve) => { let { port } = devServer.address; let host = 'localhost'; let socket = new net.Socket(); @@ -107,8 +107,8 @@ describe('API routes in SSR', () => { }); let rawResponse = ''; - socket.setEncoding('utf-8') - socket.on('data', chunk => { + socket.setEncoding('utf-8'); + socket.on('data', (chunk) => { rawResponse += chunk.toString(); socket.destroy(); }); @@ -119,11 +119,11 @@ describe('API routes in SSR', () => { let count = 0; let exp = /set-cookie\:/g; - while(exp.exec(response)) { + while (exp.exec(response)) { count++; } - expect(count).to.equal(2, 'Found two seperate set-cookie response headers') + expect(count).to.equal(2, 'Found two seperate set-cookie response headers'); }); }); });