Skip to content

Commit 98bd527

Browse files
failing test
1 parent d92fa43 commit 98bd527

File tree

3 files changed

+43
-0
lines changed

3 files changed

+43
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { flushSync } from 'svelte';
2+
import { test } from '../../test';
3+
4+
export default test({
5+
test({ assert, target, logs }) {
6+
let btn = target.querySelector('button');
7+
8+
btn?.click();
9+
btn?.click();
10+
flushSync();
11+
12+
assert.deepEqual(logs, ['error caught 1', 'error caught 2']);
13+
}
14+
});
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<script lang="ts">
2+
import Test from './test.svelte';
3+
</script>
4+
5+
<svelte:boundary onerror={(e) => {console.log(e.stack)}}>
6+
<Test />
7+
</svelte:boundary>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<script>
2+
let count = $state(0);
3+
4+
let test = $derived.by(() => {
5+
if (count > 1) {
6+
throw new Error('test');
7+
}
8+
});
9+
</script>
10+
11+
<svelte:boundary onerror={(e) => {console.log('error caught 1')}}>
12+
<div>Count: {count}</div>
13+
<button onclick={() => count++}>Increment</button>
14+
{count} / {test}
15+
</svelte:boundary>
16+
17+
18+
<svelte:boundary onerror={(e) => {console.log('error caught 2')}}>
19+
<div>Count: {count}</div>
20+
<button onclick={() => count++}>Increment</button>
21+
{count} / {test}
22+
</svelte:boundary>

0 commit comments

Comments
 (0)