mirror of https://github.com/sveltejs/svelte
Merge branch 'tanhauhau/exported-variable-could-be-reassigned' of https://github.com/tanhauhau/svelte into tanhauhau-tanhauhau/exported-variable-could-be-reassigned
commit
78c226b7b1
@ -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