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.
28 lines
350 B
28 lines
350 B
4 years ago
|
let count = 0;
|
||
|
let value = 'foo';
|
||
|
|
||
|
export default {
|
||
|
props: {
|
||
|
value() {
|
||
|
count++;
|
||
|
return value;
|
||
|
}
|
||
|
},
|
||
|
|
||
|
html: `
|
||
|
<div>foo</div>
|
||
|
<div>foo</div>
|
||
|
`,
|
||
|
|
||
|
test({ assert, component, target }) {
|
||
|
value = 'bar';
|
||
|
component.id = 1;
|
||
|
|
||
|
assert.equal(count, 4);
|
||
|
assert.htmlEqual(target.innerHTML, `
|
||
|
<div>bar</div>
|
||
|
<div>bar</div>
|
||
|
`);
|
||
|
}
|
||
|
};
|