mirror of https://github.com/sveltejs/svelte
parent
9534b27ac5
commit
8c4fd74543
@ -0,0 +1,27 @@
|
|||||||
|
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>`);
|
||||||
|
},
|
||||||
|
};
|
@ -0,0 +1,6 @@
|
|||||||
|
<script>
|
||||||
|
import { writable } from 'svelte/store';
|
||||||
|
export let foo = writable(0);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<h1>{$foo}</h1>
|
Loading…
Reference in new issue