Skip to content

Commit 3614493

Browse files
committed
add test
1 parent 8be9f5c commit 3614493

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { test } from '../../test';
2+
3+
export default test({
4+
html: `<button>0</button>`,
5+
6+
async test({ assert, target }) {
7+
const [b1] = target.querySelectorAll('button');
8+
9+
b1?.click();
10+
await Promise.resolve();
11+
assert.htmlEqual(target.innerHTML, '<button>1</button>');
12+
}
13+
});
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<script>
2+
let count = $state(0);
3+
function increment() {
4+
count += arguments.length;
5+
}
6+
</script>
7+
8+
<button on:click={increment}>{count}</button>

0 commit comments

Comments
 (0)