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/each-block-keyed-dynamic-key/_config.js

38 lines
437 B

let count = 0;
let value = 'foo';
export default {
get props() {
return {
value() {
count++;
return value;
}
};
},
before_test() {
count = 0;
value = 'foo';
},
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>
`
);
}
};