mirror of https://github.com/sveltejs/svelte
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.
27 lines
409 B
27 lines
409 B
7 years ago
|
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);
|
||
|
}
|
||
|
};
|