Skip to content

Commit d377df7

Browse files
committed
cheat
1 parent c2c3fec commit d377df7

File tree

1 file changed

+5
-5
lines changed
  • packages/svelte/tests/runtime-runes/samples/async-resolve-stale

1 file changed

+5
-5
lines changed

packages/svelte/tests/runtime-runes/samples/async-resolve-stale/_config.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,27 @@ import { test } from '../../test';
33
export default test({
44
async test({ assert, target }) {
55
// We gotta wait a bit more in this test because of the macrotasks in App.svelte
6-
function macrotask(t = 3) {
6+
function sleep(t = 50) {
77
return new Promise((r) => setTimeout(r, t));
88
}
99

10-
await macrotask();
10+
await sleep();
1111
assert.htmlEqual(target.innerHTML, '<input> 1 | ');
1212

1313
const [input] = target.querySelectorAll('input');
1414

1515
input.value = '1';
1616
input.dispatchEvent(new Event('input', { bubbles: true }));
17-
await macrotask();
17+
await sleep();
1818
assert.htmlEqual(target.innerHTML, '<input> 1 | ');
1919

2020
input.value = '12';
2121
input.dispatchEvent(new Event('input', { bubbles: true }));
22-
await macrotask(6);
22+
await sleep();
2323
assert.htmlEqual(target.innerHTML, '<input> 3 | 12');
2424
input.value = '';
2525
input.dispatchEvent(new Event('input', { bubbles: true }));
26-
await macrotask();
26+
await sleep();
2727
assert.htmlEqual(target.innerHTML, '<input> 4 | ');
2828
}
2929
});

0 commit comments

Comments
 (0)