@@ -268,6 +268,7 @@ describe('createSubscription', () => {
268
268
expect ( Scheduler ) . toFlushAndYield ( [ 'b-1' ] ) ;
269
269
} ) ;
270
270
271
+ // @gate experimental || !enableSyncDefaultUpdates
271
272
it ( 'should ignore values emitted by a new subscribable until the commit phase' , ( ) => {
272
273
const log = [ ] ;
273
274
@@ -325,7 +326,13 @@ describe('createSubscription', () => {
325
326
expect ( log ) . toEqual ( [ 'Parent.componentDidMount' ] ) ;
326
327
327
328
// Start React update, but don't finish
328
- ReactNoop . render ( < Parent observed = { observableB } /> ) ;
329
+ if ( gate ( flags => flags . enableSyncDefaultUpdates ) ) {
330
+ React . unstable_startTransition ( ( ) => {
331
+ ReactNoop . render ( < Parent observed = { observableB } /> ) ;
332
+ } ) ;
333
+ } else {
334
+ ReactNoop . render ( < Parent observed = { observableB } /> ) ;
335
+ }
329
336
expect ( Scheduler ) . toFlushAndYieldThrough ( [ 'Subscriber: b-0' ] ) ;
330
337
expect ( log ) . toEqual ( [ 'Parent.componentDidMount' ] ) ;
331
338
@@ -355,6 +362,7 @@ describe('createSubscription', () => {
355
362
] ) ;
356
363
} ) ;
357
364
365
+ // @gate experimental || !enableSyncDefaultUpdates
358
366
it ( 'should not drop values emitted between updates' , ( ) => {
359
367
const log = [ ] ;
360
368
@@ -412,7 +420,13 @@ describe('createSubscription', () => {
412
420
expect ( log ) . toEqual ( [ 'Parent.componentDidMount' ] ) ;
413
421
414
422
// Start React update, but don't finish
415
- ReactNoop . render ( < Parent observed = { observableB } /> ) ;
423
+ if ( gate ( flags => flags . enableSyncDefaultUpdates ) ) {
424
+ React . unstable_startTransition ( ( ) => {
425
+ ReactNoop . render ( < Parent observed = { observableB } /> ) ;
426
+ } ) ;
427
+ } else {
428
+ ReactNoop . render ( < Parent observed = { observableB } /> ) ;
429
+ }
416
430
expect ( Scheduler ) . toFlushAndYieldThrough ( [ 'Subscriber: b-0' ] ) ;
417
431
expect ( log ) . toEqual ( [ 'Parent.componentDidMount' ] ) ;
418
432
0 commit comments