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
420 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.on('state', ({ current }) => {
values.push(current.foo);
});
component.destroy();
assert.deepEqual(values, [2]);
assert.equal(valueOnDestroy, 2);
}
};