summaryrefslogtreecommitdiff
path: root/packages/integrations/cloudflare/test/test-utils.js
diff options
context:
space:
mode:
authorGravatar Bjorn Lu <bjornlu.dev@gmail.com> 2023-07-17 20:30:02 +0800
committerGravatar GitHub <noreply@github.com> 2023-07-17 20:30:02 +0800
commitd69fe3a8d2e1c5d49fe08aa3d974fc37cee9ca93 (patch)
tree68204dbd11dca7d6a70e5139fecff5d05bc33823 /packages/integrations/cloudflare/test/test-utils.js
parent16af1709a57066a1cce443c1d769e7304ebd4101 (diff)
downloadastro-d69fe3a8d2e1c5d49fe08aa3d974fc37cee9ca93.tar.gz
astro-d69fe3a8d2e1c5d49fe08aa3d974fc37cee9ca93.tar.zst
astro-d69fe3a8d2e1c5d49fe08aa3d974fc37cee9ca93.zip
Handle flaky tests (#7651)
Diffstat (limited to 'packages/integrations/cloudflare/test/test-utils.js')
-rw-r--r--packages/integrations/cloudflare/test/test-utils.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/packages/integrations/cloudflare/test/test-utils.js b/packages/integrations/cloudflare/test/test-utils.js
index e0fc90a64..bff7fb2a4 100644
--- a/packages/integrations/cloudflare/test/test-utils.js
+++ b/packages/integrations/cloudflare/test/test-utils.js
@@ -5,6 +5,7 @@ import { fileURLToPath } from 'url';
export { fixLineEndings } from '../../../astro/test/test-utils.js';
/**
+ * @typedef {{ ready: Promise<void>, stop: Promise<void> }} WranglerCLI
* @typedef {import('../../../astro/test/test-utils').Fixture} Fixture
*/
@@ -19,6 +20,9 @@ const wranglerPath = fileURLToPath(
new URL('../node_modules/wrangler/bin/wrangler.js', import.meta.url)
);
+/**
+ * @returns {WranglerCLI}
+ */
export function runCLI(basePath, { silent, port = 8787 }) {
const script = fileURLToPath(new URL(`${basePath}/dist/_worker.js`, import.meta.url));
const p = spawn('node', [wranglerPath, 'dev', '-l', script, '--port', port]);