summaryrefslogtreecommitdiff
path: root/test/astro-dynamic.test.js
diff options
context:
space:
mode:
authorGravatar Matthew Phillips <matthew@matthewphillips.info> 2021-04-19 16:13:53 -0400
committerGravatar GitHub <noreply@github.com> 2021-04-19 16:13:53 -0400
commitcc1a318c415fddfe1afd0c526e52ff112c5dd1b2 (patch)
treed46e8dcfb2498808b1df961c1f0cce0ee566ea99 /test/astro-dynamic.test.js
parentb25d2cc93e6a661f329ad6d8d3a595adc06cee1c (diff)
downloadastro-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/astro-dynamic.test.js')
-rw-r--r--test/astro-dynamic.test.js13
1 files changed, 12 insertions, 1 deletions
diff --git a/test/astro-dynamic.test.js b/test/astro-dynamic.test.js
index 0dcc30654..6c726131c 100644
--- a/test/astro-dynamic.test.js
+++ b/test/astro-dynamic.test.js
@@ -1,11 +1,12 @@
import { suite } from 'uvu';
import * as assert from 'uvu/assert';
import { doc } from './test-utils.js';
-import { setup } from './helpers.js';
+import { setup, setupBuild } from './helpers.js';
const DynamicComponents = suite('Dynamic components tests');
setup(DynamicComponents, './fixtures/astro-dynamic');
+setupBuild(DynamicComponents, './fixtures/astro-dynamic');
DynamicComponents('Loads client-only packages', async ({ runtime }) => {
let result = await runtime.load('/');
@@ -27,4 +28,14 @@ DynamicComponents('Loads client-only packages', async ({ runtime }) => {
assert.equal(result.statusCode, 200, 'Can load react-dom');
});
+DynamicComponents('Can be built', async ({ build }) => {
+ try {
+ await build();
+ assert.ok(true, 'Can build a project with svelte dynamic components');
+ } catch(err) {
+ console.log(err);
+ assert.ok(false, 'build threw');
+ }
+});
+
DynamicComponents.run();