Skip to content

Commit 184882c

Browse files
committed
chore: add test for accessors
1 parent 1d68216 commit 184882c

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { ok, test } from '../../test';
2+
import { flushSync } from 'svelte';
3+
4+
export default test({
5+
html: `<p>0</p>`,
6+
7+
async test({ assert, target, instance }) {
8+
const p = target.querySelector('p');
9+
ok(p);
10+
flushSync(() => {
11+
instance.count++;
12+
});
13+
assert.equal(p.innerHTML, '1');
14+
}
15+
});
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<script>
2+
let { count=0 } = $props();
3+
4+
export {
5+
count
6+
}
7+
</script>
8+
9+
<p>{count}</p>

0 commit comments

Comments
 (0)