File tree Expand file tree Collapse file tree 1 file changed +34
-20
lines changed Expand file tree Collapse file tree 1 file changed +34
-20
lines changed Original file line number Diff line number Diff line change @@ -337,12 +337,14 @@ test('does not work after it resolves', async () => {
337
337
338
338
let data = null
339
339
setTimeout ( ( ) => {
340
+ contextStack . push ( 'timeout' )
340
341
data = 'resolved'
341
342
} , 100 )
342
343
343
344
contextStack . push ( 'waitFor:start' )
344
345
await waitFor (
345
346
( ) => {
347
+ contextStack . push ( 'callback' )
346
348
// eslint-disable-next-line jest/no-conditional-in-test -- false-positive
347
349
if ( data === null ) {
348
350
throw new Error ( 'not found' )
@@ -352,27 +354,39 @@ test('does not work after it resolves', async () => {
352
354
)
353
355
contextStack . push ( 'waitFor:end' )
354
356
355
- expect ( contextStack ) . toEqual ( [
356
- 'waitFor:start' ,
357
- 'no-act:start' ,
358
- 'act:start' ,
359
- 'act:end' ,
360
- 'act:start' ,
361
- 'act:end' ,
362
- 'no-act:end' ,
363
- 'waitFor:end' ,
364
- ] )
357
+ expect ( contextStack ) . toMatchInlineSnapshot ( `
358
+ [
359
+ waitFor:start,
360
+ no-act:start,
361
+ callback,
362
+ act:start,
363
+ act:end,
364
+ callback,
365
+ act:start,
366
+ timeout,
367
+ act:end,
368
+ callback,
369
+ no-act:end,
370
+ waitFor:end,
371
+ ]
372
+ ` )
365
373
366
374
await Promise . resolve ( )
367
375
368
- expect ( contextStack ) . toEqual ( [
369
- 'waitFor:start' ,
370
- 'no-act:start' ,
371
- 'act:start' ,
372
- 'act:end' ,
373
- 'act:start' ,
374
- 'act:end' ,
375
- 'no-act:end' ,
376
- 'waitFor:end' ,
377
- ] )
376
+ expect ( contextStack ) . toMatchInlineSnapshot ( `
377
+ [
378
+ waitFor:start,
379
+ no-act:start,
380
+ callback,
381
+ act:start,
382
+ act:end,
383
+ callback,
384
+ act:start,
385
+ timeout,
386
+ act:end,
387
+ callback,
388
+ no-act:end,
389
+ waitFor:end,
390
+ ]
391
+ ` )
378
392
} )
You can’t perform that action at this time.
0 commit comments