pull/11263/head
Rich Harris 2 years ago
parent 070b05696c
commit 82873e6a63

@ -0,0 +1,15 @@
import { flushSync } from 'svelte';
import { test } from '../../test';
export default test({
html: `<div><button>0 0</button>`,
async test({ assert, target }) {
const button1 = target.querySelector('button');
flushSync(() => button1?.click());
assert.htmlEqual(target.innerHTML, `<div><button>1 1</button></div>`);
},
runtime_error: 'nope'
});

@ -0,0 +1,19 @@
<script>
let y = $state(0);
let n = $state(0);
function yep() {
y += 1;
}
function nope() {
n += 1;
throw new Error('nope');
}
</script>
<div onclick={yep}>
<button onclick={nope}>
{y} {n}
</button>
</div>
Loading…
Cancel
Save