diff options
Diffstat (limited to 'test/helpers.js')
-rw-r--r-- | test/helpers.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/helpers.js b/test/helpers.js index 8ca42ea11..eb7cabb0b 100644 --- a/test/helpers.js +++ b/test/helpers.js @@ -4,6 +4,8 @@ import { readFile } from 'fs/promises'; import { createRuntime } from '../lib/runtime.js'; import { loadConfig } from '../lib/config.js'; import * as assert from 'uvu/assert'; +import execa from 'execa'; + /** setup fixtures for tests */ export function setup(Suite, fixturePath) { let runtime, setupError; @@ -62,3 +64,10 @@ export function setupBuild(Suite, fixturePath) { assert.equal(setupError, undefined); }); } + +const cliURL = new URL('../astro.mjs', import.meta.url); +export function runDevServer(root, additionalArgs = []) { + const args = [cliURL.pathname, 'dev', '--project-root', root.pathname].concat(additionalArgs); + const proc = execa('node', args); + return proc; +}
\ No newline at end of file |