From 3a599f2144c1a802023b9b0b61b79b230c878425 Mon Sep 17 00:00:00 2001 From: matthewp Date: Wed, 27 Jul 2022 20:17:38 +0000 Subject: [PATCH] [ci] format --- packages/integrations/cloudflare/src/index.ts | 4 +-- .../cloudflare/test/basics.test.js | 1 - .../cloudflare/test/test-utils.js | 27 +++++++++++-------- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/packages/integrations/cloudflare/src/index.ts b/packages/integrations/cloudflare/src/index.ts index 99560dfdd..76904ed95 100644 --- a/packages/integrations/cloudflare/src/index.ts +++ b/packages/integrations/cloudflare/src/index.ts @@ -75,8 +75,8 @@ export default function createIntegration(): AstroIntegration { bundle: true, minify: true, banner: { - js: SHIM - } + js: SHIM, + }, }); // throw the server folder in the bin diff --git a/packages/integrations/cloudflare/test/basics.test.js b/packages/integrations/cloudflare/test/basics.test.js index 67215374d..e6fe6642e 100644 --- a/packages/integrations/cloudflare/test/basics.test.js +++ b/packages/integrations/cloudflare/test/basics.test.js @@ -29,4 +29,3 @@ describe('Basic app', () => { } }); }); - diff --git a/packages/integrations/cloudflare/test/test-utils.js b/packages/integrations/cloudflare/test/test-utils.js index 41cc8a2c9..e0f521949 100644 --- a/packages/integrations/cloudflare/test/test-utils.js +++ b/packages/integrations/cloudflare/test/test-utils.js @@ -11,7 +11,9 @@ export function loadFixture(config) { return baseLoadFixture(config); } -const wranglerPath = fileURLToPath(new URL('../node_modules/wrangler/bin/wrangler.js', import.meta.url)); +const wranglerPath = fileURLToPath( + new URL('../node_modules/wrangler/bin/wrangler.js', import.meta.url) +); export function runCLI(basePath, { silent }) { const script = fileURLToPath(new URL(`${basePath}/dist/_worker.js`, import.meta.url)); @@ -23,23 +25,26 @@ export function runCLI(basePath, { silent }) { const timeout = 10000; const ready = new Promise(async (resolve, reject) => { - const failed = setTimeout(() => reject(new Error(`Timed out starting the wrangler CLI`)), timeout); + const failed = setTimeout( + () => reject(new Error(`Timed out starting the wrangler CLI`)), + timeout + ); (async function () { - for(const msg of p.stderr) { - if(!silent) { + for (const msg of p.stderr) { + if (!silent) { // eslint-disable-next-line console.error(msg); } } })(); - for await(const msg of p.stdout) { - if(!silent) { + for await (const msg of p.stdout) { + if (!silent) { // eslint-disable-next-line console.log(msg); } - if(msg.includes(`Listening on`)) { + if (msg.includes(`Listening on`)) { break; } } @@ -52,11 +57,11 @@ export function runCLI(basePath, { silent }) { ready, stop() { p.kill(); - return new Promise(resolve => { + return new Promise((resolve) => { p.addListener('exit', () => { resolve(); }); - }) - } - } + }); + }, + }; }