Skip to content

Commit bd35fc2

Browse files
committed
failing test
1 parent 02e9f00 commit bd35fc2

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { flushSync } from 'svelte';
2+
import { test } from '../../test';
3+
4+
export default test({
5+
html: `<button>increment</button><p>a: 1</p><p>b: 2</p><p>c: 3</p>`,
6+
7+
test({ assert, target }) {
8+
const button = target.querySelector('button');
9+
10+
flushSync(() => button?.click());
11+
assert.htmlEqual(
12+
target.innerHTML,
13+
`<button>increment</button><p>a: 2</p><p>b: 3</p><p>c: 4</p>`
14+
);
15+
}
16+
});
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<script>
2+
let offset = $state(1);
3+
4+
function* count(offset) {
5+
let i = offset;
6+
while (true) yield i++;
7+
}
8+
9+
let [a, b, c] = $derived(count(offset));
10+
</script>
11+
12+
<button onclick={() => offset += 1}>increment</button>
13+
14+
<p>a: {a}</p>
15+
<p>b: {b}</p>
16+
<p>c: {c}</p>

0 commit comments

Comments
 (0)