File tree Expand file tree Collapse file tree 1 file changed +7
-13
lines changed
packages/use-subscription/src/__tests__ Expand file tree Collapse file tree 1 file changed +7
-13
lines changed Original file line number Diff line number Diff line change @@ -602,28 +602,22 @@ describe('useSubscription', () => {
602
602
// This update will be eagerly evaluated,
603
603
// so the tearing case this test is guarding against would not happen.
604
604
mutate ( 'B' ) ;
605
- expect ( Scheduler ) . toFlushAndYieldThrough ( [ 'render:first:B' ] ) ;
606
- mutate ( 'C' ) ;
607
- expect ( Scheduler ) . toFlushAndYield ( [
608
- 'render:second:B' ,
609
- 'render:first:C' ,
610
- 'render:second:C' ,
611
- ] ) ;
605
+ expect ( Scheduler ) . toFlushAndYield ( [ 'render:first:B' , 'render:second:B' ] ) ;
612
606
613
607
// No more pending updates
614
608
jest . runAllTimers ( ) ;
615
609
616
- // Partial update "C " -> "D "
617
- // Interrupt with a second mutation "D " -> "E ".
610
+ // Partial update "B " -> "C "
611
+ // Interrupt with a second mutation "C " -> "D ".
618
612
// This update will not be eagerly evaluated,
619
613
// but useSubscription() should eagerly close over the updated value to avoid tearing.
614
+ mutate ( 'C' ) ;
615
+ expect ( Scheduler ) . toFlushAndYieldThrough ( [ 'render:first:C' ] ) ;
620
616
mutate ( 'D' ) ;
621
- expect ( Scheduler ) . toFlushAndYieldThrough ( [ 'render:first:D' ] ) ;
622
- mutate ( 'E' ) ;
623
617
expect ( Scheduler ) . toFlushAndYield ( [
618
+ 'render:second:C' ,
619
+ 'render:first:D' ,
624
620
'render:second:D' ,
625
- 'render:first:E' ,
626
- 'render:second:E' ,
627
621
] ) ;
628
622
629
623
// No more pending updates
You can’t perform that action at this time.
0 commit comments