Skip to content

Commit c8294cc

Browse files
committed
test IIFE support
1 parent 59a96c9 commit c8294cc

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

packages/svelte/tests/runtime-runes/samples/bind-spread/_config.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,22 @@ export default test({
55
async test({ assert, target, logs }) {
66
const checkboxes = target.querySelectorAll('input');
77

8-
// input.value = '2';
9-
// input.dispatchEvent(new window.Event('input'));
10-
118
flushSync();
129

13-
assert.htmlEqual(target.innerHTML, `<input type="checkbox" >`.repeat(4));
14-
15-
// assert.deepEqual(logs, ['b', '2', 'a', '2']);
10+
assert.htmlEqual(target.innerHTML, `<input type="checkbox" >`.repeat(checkboxes.length));
1611

1712
flushSync(() => {
1813
checkboxes.forEach((checkbox) => checkbox.click());
1914
});
2015
assert.deepEqual(logs, [
2116
'getArrayBindings',
2217
'getObjectBindings',
23-
...repeatArray(4, ['check', false])
18+
...repeatArray(checkboxes.length, ['check', false])
2419
]);
2520
}
2621
});
2722

2823
/** @template T */
29-
function repeatArray(/** @type {number} */ times = 1, /** @type {T[]} */ array) {
24+
function repeatArray(/** @type {number} */ times, /** @type {T[]} */ array) {
3025
return /** @type {T[]} */ Array.from({ length: times }, () => array).flat();
3126
}

packages/svelte/tests/runtime-runes/samples/bind-spread/main.svelte

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,6 @@
2828

2929
<input type="checkbox" bind:checked={...getArrayBindings()} />
3030

31+
<input type="checkbox" bind:checked={...(() => check_bindings)()} />
32+
3133
<input type="checkbox" bind:checked={...getObjectBindings()} />

0 commit comments

Comments
 (0)