diff options
Diffstat (limited to 'test/helpers.js')
-rw-r--r-- | test/helpers.js | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/test/helpers.js b/test/helpers.js index aa2e31714..ab4c28f30 100644 --- a/test/helpers.js +++ b/test/helpers.js @@ -1,6 +1,7 @@ import { fileURLToPath } from 'url'; -import { createRuntime } from '../lib/runtime.js'; +import { build as astroBuild } from '../lib/build.js'; import { loadConfig } from '../lib/config.js'; +import { createRuntime } from '../lib/runtime.js'; import * as assert from 'uvu/assert'; /** setup fixtures for tests */ export function setup(Suite, fixturePath) { @@ -32,3 +33,27 @@ export function setup(Suite, fixturePath) { assert.equal(setupError, undefined); }); } + +export function setupBuild(Suite, fixturePath) { + let build, setupError; + + Suite.before(async (context) => { + const astroConfig = await loadConfig(fileURLToPath(new URL(fixturePath, import.meta.url))); + + const logging = { + level: 'error', + dest: process.stderr, + }; + + build = (...args) => astroBuild(astroConfig, ...args); + context.build = build; + }); + + Suite.after(async () => { + // Shutdown i guess. + }); + + Suite('No errors creating a runtime', () => { + assert.equal(setupError, undefined); + }); +}
\ No newline at end of file |