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/set-in-ondestroy/_config.js

27 lines
409 B

export default {
'skip-ssr': true,
data: {
foo: 1
},
test(assert, component) {
const values = [];
let valueOnDestroy;
component.on('destroy', () => {
component.set({ foo: 2 });
valueOnDestroy = component.get('foo');
});
component.observe('foo', foo => {
values.push(foo);
});
component.destroy();
assert.deepEqual(values, [1, 2]);
assert.equal(valueOnDestroy, 2);
}
};