diff --git a/test/runtime/samples/component-not-constructor-dev/Sub.svelte b/test/runtime/samples/component-not-constructor-dev/Sub.svelte
new file mode 100644
index 0000000000..dd6d0bb1a9
--- /dev/null
+++ b/test/runtime/samples/component-not-constructor-dev/Sub.svelte
@@ -0,0 +1 @@
+
Sub
\ No newline at end of file
diff --git a/test/runtime/samples/component-not-constructor-dev/_config.js b/test/runtime/samples/component-not-constructor-dev/_config.js
new file mode 100644
index 0000000000..facdcccd25
--- /dev/null
+++ b/test/runtime/samples/component-not-constructor-dev/_config.js
@@ -0,0 +1,11 @@
+export default {
+ skip_if_ssr: true,
+ skip_if_hydrate_from_ssr: true,
+ compileOptions: {
+ dev: true
+ },
+ props: {
+ selected: false
+ },
+ error: 'this={...} of should specify a Svelte component.'
+};
diff --git a/test/runtime/samples/component-not-constructor-dev/main.svelte b/test/runtime/samples/component-not-constructor-dev/main.svelte
new file mode 100644
index 0000000000..dec7e2af79
--- /dev/null
+++ b/test/runtime/samples/component-not-constructor-dev/main.svelte
@@ -0,0 +1,9 @@
+
+
+
diff --git a/test/runtime/samples/component-not-constructor/_config.js b/test/runtime/samples/component-not-constructor/_config.js
index facdcccd25..8c0dcced41 100644
--- a/test/runtime/samples/component-not-constructor/_config.js
+++ b/test/runtime/samples/component-not-constructor/_config.js
@@ -1,11 +1,8 @@
export default {
skip_if_ssr: true,
skip_if_hydrate_from_ssr: true,
- compileOptions: {
- dev: true
- },
props: {
selected: false
},
- error: 'this={...} of should specify a Svelte component.'
+ error: 'component is not a constructor'
};
diff --git a/test/runtime/samples/component-not-constructor2-dev/Sub.svelte b/test/runtime/samples/component-not-constructor2-dev/Sub.svelte
new file mode 100644
index 0000000000..dd6d0bb1a9
--- /dev/null
+++ b/test/runtime/samples/component-not-constructor2-dev/Sub.svelte
@@ -0,0 +1 @@
+Sub
\ No newline at end of file
diff --git a/test/runtime/samples/component-not-constructor2-dev/_config.js b/test/runtime/samples/component-not-constructor2-dev/_config.js
new file mode 100644
index 0000000000..98e3cc942b
--- /dev/null
+++ b/test/runtime/samples/component-not-constructor2-dev/_config.js
@@ -0,0 +1,19 @@
+export default {
+ compileOptions: {
+ dev: true
+ },
+ props: {
+ componentName: 'Sub'
+ },
+ html: 'Sub
',
+ test({ assert, component, target }) {
+ component.componentName = 'Proxy';
+ assert.htmlEqual(target.innerHTML, 'Sub
');
+ try {
+ component.componentName = 'banana';
+ throw new Error('Expected an error');
+ } catch (err) {
+ assert.equal(err.message, 'this={...} of should specify a Svelte component.');
+ }
+ }
+};
diff --git a/test/runtime/samples/component-not-constructor2-dev/main.svelte b/test/runtime/samples/component-not-constructor2-dev/main.svelte
new file mode 100644
index 0000000000..331fdfc385
--- /dev/null
+++ b/test/runtime/samples/component-not-constructor2-dev/main.svelte
@@ -0,0 +1,14 @@
+
+
+
diff --git a/test/runtime/samples/component-not-constructor2/_config.js b/test/runtime/samples/component-not-constructor2/_config.js
index 13ed09cecc..8fae65afdd 100644
--- a/test/runtime/samples/component-not-constructor2/_config.js
+++ b/test/runtime/samples/component-not-constructor2/_config.js
@@ -1,16 +1,16 @@
export default {
- compileOptions: {
- dev: true
- },
props: {
- selected: true
+ componentName: 'Sub'
},
- test({ assert, component }) {
+ html: 'Sub
',
+ test({ assert, component, target }) {
+ component.componentName = 'Proxy';
+ assert.htmlEqual(target.innerHTML, 'Sub
');
try {
- component.selected = false;
+ component.componentName = 'banana';
throw new Error('Expected an error');
} catch (err) {
- assert.equal(err.message, 'this={...} of should specify a Svelte component.');
+ assert.equal(err.message, 'component is not a constructor');
}
}
};
diff --git a/test/runtime/samples/component-not-constructor2/main.svelte b/test/runtime/samples/component-not-constructor2/main.svelte
index dec7e2af79..331fdfc385 100644
--- a/test/runtime/samples/component-not-constructor2/main.svelte
+++ b/test/runtime/samples/component-not-constructor2/main.svelte
@@ -1,9 +1,14 @@