File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
packages/svelte/tests/runtime-runes/samples/async-resolve-stale Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -3,27 +3,27 @@ import { test } from '../../test';
33export 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} ) ;
You can’t perform that action at this time.
0 commit comments