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.
svelte/test/runtime/samples/component-not-constructor2/_config.js

17 lines
391 B

export default {
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, 'component is not a constructor');
}
}
};