mirror of https://github.com/sveltejs/svelte
parent
76b07e5b57
commit
63950858d6
@ -0,0 +1,13 @@
|
|||||||
|
import { flushSync } from 'svelte';
|
||||||
|
import { test } from '../../test';
|
||||||
|
|
||||||
|
export default test({
|
||||||
|
html: `<button>10</button>`,
|
||||||
|
ssrHtml: `<button>0</button>`,
|
||||||
|
|
||||||
|
async test({ assert, target }) {
|
||||||
|
flushSync();
|
||||||
|
|
||||||
|
assert.htmlEqual(target.innerHTML, `<button>10</button>`);
|
||||||
|
}
|
||||||
|
});
|
@ -0,0 +1,12 @@
|
|||||||
|
<script>
|
||||||
|
const counter = new class Counter {
|
||||||
|
constructor() {
|
||||||
|
this.count = $state(0);
|
||||||
|
$effect(() => {
|
||||||
|
this.count = 10;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<button on:click={() => counter.count++}>{counter.count}</button>
|
Loading…
Reference in new issue