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-observe-dollar/_config.js

25 lines
373 B

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 = [];
component.observe('$name', name => {
names.push(name);
});
store.set({ name: 'everybody' });
assert.deepEqual(names, ['world', 'everybody']);
}
};