diff options
author | 2021-04-19 16:13:53 -0400 | |
---|---|---|
committer | 2021-04-19 16:13:53 -0400 | |
commit | cc1a318c415fddfe1afd0c526e52ff112c5dd1b2 (patch) | |
tree | d46e8dcfb2498808b1df961c1f0cce0ee566ea99 /test/helpers.js | |
parent | b25d2cc93e6a661f329ad6d8d3a595adc06cee1c (diff) | |
download | astro-cc1a318c415fddfe1afd0c526e52ff112c5dd1b2.tar.gz astro-cc1a318c415fddfe1afd0c526e52ff112c5dd1b2.tar.zst astro-cc1a318c415fddfe1afd0c526e52ff112c5dd1b2.zip |
Fix building of dynamic Svelte components (#115)
Svelte component resolution wasn't handled correctly during the build.
Note that in the future we need to consolidate a "framework" API, so this stuff is not sprinkled throughout the codebase.
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 |