@@ -695,28 +695,19 @@ describe('ReactSuspense', () => {
695
695
expect ( Scheduler ) . toFlushAndYield ( [ 'Child 1' , 'create layout' ] ) ;
696
696
expect ( root ) . toMatchRenderedOutput ( 'Child 1' ) ;
697
697
698
- ReactTestRenderer . act ( ( ) => {
698
+ act ( ( ) => {
699
699
_setShow ( true ) ;
700
700
} ) ;
701
- expect ( Scheduler ) . toHaveYielded (
702
- // DEV behavior differs from prod
703
- // In DEV sometimes the work loop sync-flushes the commit
704
- // where as in production, it schedules it behind a timeout.
705
- // See shouldForceFlushFallbacksInDEV() usage
706
- __DEV__
707
- ? [ 'Child 1' , 'Suspend! [Child 2]' , 'Loading...' , 'destroy layout' ]
708
- : [ 'Child 1' , 'Suspend! [Child 2]' , 'Loading...' ] ,
709
- ) ;
701
+ expect ( Scheduler ) . toHaveYielded ( [
702
+ 'Child 1' ,
703
+ 'Suspend! [Child 2]' ,
704
+ 'Loading...' ,
705
+ ] ) ;
710
706
jest . advanceTimersByTime ( 1000 ) ;
711
- expect ( Scheduler ) . toHaveYielded (
712
- // DEV behavior differs from prod
713
- // In DEV sometimes the work loop sync-flushes the commit
714
- // where as in production, it schedules it behind a timeout.
715
- // See shouldForceFlushFallbacksInDEV() usage
716
- __DEV__
717
- ? [ 'Promise resolved [Child 2]' ]
718
- : [ 'destroy layout' , 'Promise resolved [Child 2]' ] ,
719
- ) ;
707
+ expect ( Scheduler ) . toHaveYielded ( [
708
+ 'destroy layout' ,
709
+ 'Promise resolved [Child 2]' ,
710
+ ] ) ;
720
711
expect ( Scheduler ) . toFlushAndYield ( [ 'Child 1' , 'Child 2' , 'create layout' ] ) ;
721
712
expect ( root ) . toMatchRenderedOutput ( [ 'Child 1' , 'Child 2' ] . join ( '' ) ) ;
722
713
} ) ;
0 commit comments