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/dev-warning-destroy-twice/_config.js

23 lines
448 B

export default {
compileOptions: {
dev: true
},
test(assert, component) {
const warn = console.warn; // eslint-disable-line no-console
const warnings = [];
console.warn = warning => { // eslint-disable-line no-console
warnings.push(warning);
};
component.destroy();
component.destroy();
assert.deepEqual(warnings, [
`Component was already destroyed`
]);
console.warn = warn; // eslint-disable-line no-console
}
};