Skip to content

Commit 82873e6

Browse files
committed
test
1 parent 070b056 commit 82873e6

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { flushSync } from 'svelte';
2+
import { test } from '../../test';
3+
4+
export default test({
5+
html: `<div><button>0 0</button>`,
6+
7+
async test({ assert, target }) {
8+
const button1 = target.querySelector('button');
9+
10+
flushSync(() => button1?.click());
11+
assert.htmlEqual(target.innerHTML, `<div><button>1 1</button></div>`);
12+
},
13+
14+
runtime_error: 'nope'
15+
});
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<script>
2+
let y = $state(0);
3+
let n = $state(0);
4+
5+
function yep() {
6+
y += 1;
7+
}
8+
9+
function nope() {
10+
n += 1;
11+
throw new Error('nope');
12+
}
13+
</script>
14+
15+
<div onclick={yep}>
16+
<button onclick={nope}>
17+
{y} {n}
18+
</button>
19+
</div>

0 commit comments

Comments
 (0)