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.
svelte/test/runtime/samples/store-onstate-dollar/_config.js

27 lines
400 B

import { Store } from '../../../../store.js';
const store = new Store({
name: 'world'
});
export default {
store,
html: `<h1>Hello world!</h1>`,
compileOptions: {
dev: true
},
test(assert, component) {
const names = [];
component.on('state', ({ current }) => {
names.push(current.$name);
});
store.set({ name: 'everybody' });
assert.deepEqual(names, ['everybody']);
}
};