diff options
author | 2022-03-30 21:50:41 -0300 | |
---|---|---|
committer | 2022-03-30 21:50:41 -0300 | |
commit | 20c3969a433d636477525e4c0637b9bd30555e19 (patch) | |
tree | fda98636e94d6d5f867f4a3c4219c414d881b49b /packages/integrations/deno/test/helpers.js | |
parent | cf70978c417247ebd597f7759c314d8dd291b036 (diff) | |
parent | 52d7fec2480e3c8f3f046c229364a9c91cc06821 (diff) | |
download | astro-20c3969a433d636477525e4c0637b9bd30555e19.tar.gz astro-20c3969a433d636477525e4c0637b9bd30555e19.tar.zst astro-20c3969a433d636477525e4c0637b9bd30555e19.zip |
Merge branch 'main' into feat/vercel-adapter
Diffstat (limited to 'packages/integrations/deno/test/helpers.js')
-rw-r--r-- | packages/integrations/deno/test/helpers.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/packages/integrations/deno/test/helpers.js b/packages/integrations/deno/test/helpers.js new file mode 100644 index 000000000..659d24d5e --- /dev/null +++ b/packages/integrations/deno/test/helpers.js @@ -0,0 +1,20 @@ +import { fromFileUrl } from './deps.js'; +const dir = new URL('./', import.meta.url); + +export async function runBuild(fixturePath) { + let proc = Deno.run({ + cmd: ['node', '../../../../../astro/astro.js', 'build', '--silent'], + cwd: fromFileUrl(new URL(fixturePath, dir)), + }); + await proc.status(); + return async () => await proc.close(); +} + +export async function runBuildAndStartApp(fixturePath, cb) { + const url = new URL(fixturePath, dir); + const close = await runBuild(fixturePath); + const mod = await import(new URL('./dist/entry.mjs', url)); + await cb(); + await mod.stop(); + await close(); +} |