mirror of https://github.com/sveltejs/svelte
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
463 B
20 lines
463 B
2 years ago
|
export default {
|
||
|
compileOptions: {
|
||
|
dev: true
|
||
|
},
|
||
|
props: {
|
||
|
componentName: 'Sub'
|
||
|
},
|
||
|
html: '<div>Sub</div>',
|
||
|
test({ assert, component, target }) {
|
||
|
component.componentName = 'Proxy';
|
||
|
assert.htmlEqual(target.innerHTML, '<div>Sub</div>');
|
||
|
try {
|
||
|
component.componentName = 'banana';
|
||
|
throw new Error('Expected an error');
|
||
|
} catch (err) {
|
||
|
assert.equal(err.message, 'this={...} of <svelte:component> should specify a Svelte component.');
|
||
|
}
|
||
|
}
|
||
|
};
|