Skip to content

Commit 6395085

Browse files
committed
failing test
1 parent 76b07e5 commit 6395085

File tree

2 files changed

+25
-0
lines changed
  • packages/svelte/tests/runtime-runes/samples/class-state-constructor-closure-private-3

2 files changed

+25
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { flushSync } from 'svelte';
2+
import { test } from '../../test';
3+
4+
export default test({
5+
html: `<button>10</button>`,
6+
ssrHtml: `<button>0</button>`,
7+
8+
async test({ assert, target }) {
9+
flushSync();
10+
11+
assert.htmlEqual(target.innerHTML, `<button>10</button>`);
12+
}
13+
});
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<script>
2+
const counter = new class Counter {
3+
constructor() {
4+
this.count = $state(0);
5+
$effect(() => {
6+
this.count = 10;
7+
});
8+
}
9+
}
10+
</script>
11+
12+
<button on:click={() => counter.count++}>{counter.count}</button>

0 commit comments

Comments
 (0)