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.
25 lines
377 B
25 lines
377 B
7 years ago
|
import { Store } from '../../../../store.js';
|
||
|
|
||
|
const store = new Store({
|
||
|
name: 'world'
|
||
|
});
|
||
|
|
||
|
export default {
|
||
|
store,
|
||
|
|
||
|
html: `<h1>Hello world!</h1>`,
|
||
|
|
||
|
dev: true,
|
||
|
|
||
|
test(assert, component) {
|
||
|
const names = [];
|
||
|
|
||
7 years ago
|
component.on('state', ({ current }) => {
|
||
|
names.push(current.$name);
|
||
7 years ago
|
});
|
||
|
|
||
|
store.set({ name: 'everybody' });
|
||
|
|
||
7 years ago
|
assert.deepEqual(names, ['everybody']);
|
||
7 years ago
|
}
|
||
|
};
|