@@ -517,11 +517,7 @@ describe('ReactHooksWithNoopRenderer', () => {
517
517
</ > ,
518
518
) ;
519
519
expect ( ( ) =>
520
- expect ( Scheduler ) . toFlushAndYield (
521
- __DEV__
522
- ? [ 'Foo [0]' , 'Bar' , 'Foo [2]' ]
523
- : [ 'Foo [0]' , 'Bar' , 'Foo [1]' ] ,
524
- ) ,
520
+ expect ( Scheduler ) . toFlushAndYield ( [ 'Foo [0]' , 'Bar' , 'Foo [1]' ] ) ,
525
521
) . toErrorDev ( [
526
522
'Cannot update a component (`Foo`) while rendering a ' +
527
523
'different component (`Bar`). To locate the bad setState() call inside `Bar`' ,
@@ -536,11 +532,7 @@ describe('ReactHooksWithNoopRenderer', () => {
536
532
< Bar triggerUpdate = { true } />
537
533
</ > ,
538
534
) ;
539
- expect ( Scheduler ) . toFlushAndYield (
540
- __DEV__
541
- ? [ 'Foo [2]' , 'Bar' , 'Foo [4]' ]
542
- : [ 'Foo [1]' , 'Bar' , 'Foo [2]' ] ,
543
- ) ;
535
+ expect ( Scheduler ) . toFlushAndYield ( [ 'Foo [1]' , 'Bar' , 'Foo [2]' ] ) ;
544
536
} ) ;
545
537
} ) ;
546
538
@@ -1762,16 +1754,11 @@ describe('ReactHooksWithNoopRenderer', () => {
1762
1754
return < Text text = { 'Count: ' + count } /> ;
1763
1755
}
1764
1756
1765
- // we explicitly wait for missing act() warnings here since
1766
- // it's a lot harder to simulate this condition inside an act scope
1767
- expect ( ( ) => {
1768
- ReactNoop . render ( < Counter count = { 0 } /> , ( ) =>
1769
- Scheduler . unstable_yieldValue ( 'Sync effect' ) ,
1770
- ) ;
1771
- expect ( Scheduler ) . toFlushAndYieldThrough ( [ 'Count: 0' , 'Sync effect' ] ) ;
1772
- expect ( ReactNoop . getChildren ( ) ) . toEqual ( [ span ( 'Count: 0' ) ] ) ;
1773
- } ) . toErrorDev ( [ 'An update to Counter ran an effect' ] ) ;
1774
-
1757
+ ReactNoop . render ( < Counter count = { 0 } /> , ( ) =>
1758
+ Scheduler . unstable_yieldValue ( 'Sync effect' ) ,
1759
+ ) ;
1760
+ expect ( Scheduler ) . toFlushAndYieldThrough ( [ 'Count: 0' , 'Sync effect' ] ) ;
1761
+ expect ( ReactNoop . getChildren ( ) ) . toEqual ( [ span ( 'Count: 0' ) ] ) ;
1775
1762
// A flush sync doesn't cause the passive effects to fire.
1776
1763
// So we haven't added the other update yet.
1777
1764
act ( ( ) => {
0 commit comments