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.
28 lines
395 B
28 lines
395 B
5 years ago
|
let subscribeCalled = false;
|
||
|
|
||
|
const fakeStore = val => ({
|
||
|
subscribe: cb => {
|
||
|
cb(val);
|
||
|
return {
|
||
|
unsubscribe: () => {
|
||
|
subscribeCalled = true;
|
||
|
},
|
||
|
};
|
||
|
},
|
||
|
});
|
||
|
|
||
|
export default {
|
||
|
props: {
|
||
|
foo: fakeStore(1),
|
||
|
},
|
||
|
html: `
|
||
|
<h1>1</h1>
|
||
|
`,
|
||
|
|
||
|
async test({ assert, component, target }) {
|
||
|
component.foo = fakeStore(5);
|
||
|
|
||
|
return assert.htmlEqual(target.innerHTML, `<h1>5</h1>`);
|
||
|
},
|
||
|
};
|