diff options
author | 2022-07-27 20:17:38 +0000 | |
---|---|---|
committer | 2022-07-27 20:17:38 +0000 | |
commit | 3a599f2144c1a802023b9b0b61b79b230c878425 (patch) | |
tree | 84bd96501b1452442f8965cfba7c8b94d5fd451f /packages/integrations/cloudflare/test | |
parent | a198028b04234d0b8dcb0b6bcb47c5831d7a15f9 (diff) | |
download | astro-3a599f2144c1a802023b9b0b61b79b230c878425.tar.gz astro-3a599f2144c1a802023b9b0b61b79b230c878425.tar.zst astro-3a599f2144c1a802023b9b0b61b79b230c878425.zip |
[ci] format
Diffstat (limited to 'packages/integrations/cloudflare/test')
-rw-r--r-- | packages/integrations/cloudflare/test/basics.test.js | 1 | ||||
-rw-r--r-- | packages/integrations/cloudflare/test/test-utils.js | 27 |
2 files changed, 16 insertions, 12 deletions
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(); }); - }) - } - } + }); + }, + }; } |