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

19 lines
474 B

import { test } from '../../test';
export default test({
get props() {
return { 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.include(/** @type {Error} */ (err).message, '$$component is not a function');
}
}
});