Skip to content

Commit d5f785b

Browse files
committed
add a failing test
1 parent dbf2b4c commit d5f785b

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { flushSync } from 'svelte';
2+
import { test } from '../../test';
3+
4+
export default test({
5+
async test({ assert, target, logs }) {
6+
const btn = target.querySelector('button');
7+
8+
flushSync(() => btn?.click());
9+
assert.deepEqual(logs, ['b changed']);
10+
}
11+
});
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<script>
2+
let a = $state({});
3+
4+
let b = $state({ count: 0 }, {
5+
onchange() {
6+
console.log('b changed');
7+
}
8+
});
9+
10+
a.b = b;
11+
</script>
12+
13+
<button onclick={()=> b.count++}>{b.count}</button>

0 commit comments

Comments
 (0)