@@ -3477,16 +3477,16 @@ describe('Profiler', () => {
3477
3477
}
3478
3478
}
3479
3479
3480
- const onPostCommit = jest . fn ( ( ) => {
3481
- Scheduler . unstable_yieldValue ( 'onPostCommit ' ) ;
3480
+ const onCommit = jest . fn ( ( ) => {
3481
+ Scheduler . unstable_yieldValue ( 'onCommit ' ) ;
3482
3482
} ) ;
3483
- ReactNoop . act ( async ( ) => {
3483
+ await ReactNoop . act ( async ( ) => {
3484
3484
SchedulerTracing . unstable_trace (
3485
3485
interaction . name ,
3486
3486
Scheduler . unstable_now ( ) ,
3487
3487
( ) => {
3488
3488
ReactNoop . render (
3489
- < React . Profiler id = "test-profiler" onPostCommit = { onPostCommit } >
3489
+ < React . Profiler id = "test-profiler" onCommit = { onCommit } >
3490
3490
< React . Suspense fallback = { < Text text = "Loading..." /> } >
3491
3491
< AsyncText text = "Async" ms = { 20000 } />
3492
3492
</ React . Suspense >
@@ -3511,13 +3511,13 @@ describe('Profiler', () => {
3511
3511
'Text [Loading...]' ,
3512
3512
'Text [Sync]' ,
3513
3513
'Monkey' ,
3514
- 'onPostCommit ' ,
3514
+ 'onCommit ' ,
3515
3515
] ) ;
3516
3516
// Should have committed the placeholder.
3517
3517
expect ( ReactNoop . getChildrenAsJSX ( ) ) . toEqual ( 'Loading...Sync' ) ;
3518
- expect ( onPostCommit ) . toHaveBeenCalledTimes ( 1 ) ;
3518
+ expect ( onCommit ) . toHaveBeenCalledTimes ( 1 ) ;
3519
3519
3520
- let call = onPostCommit . mock . calls [ 0 ] ;
3520
+ let call = onCommit . mock . calls [ 0 ] ;
3521
3521
expect ( call [ 0 ] ) . toEqual ( 'test-profiler' ) ;
3522
3522
expect ( call [ 4 ] ) . toMatchInteractions (
3523
3523
ReactFeatureFlags . enableSchedulerTracing ? [ interaction ] : [ ] ,
@@ -3528,20 +3528,17 @@ describe('Profiler', () => {
3528
3528
3529
3529
// An unrelated update in the middle shouldn't affect things...
3530
3530
monkey . current . forceUpdate ( ) ;
3531
- expect ( Scheduler ) . toFlushAndYield ( [ 'Monkey' , 'onPostCommit ' ] ) ;
3532
- expect ( onPostCommit ) . toHaveBeenCalledTimes ( 2 ) ;
3531
+ expect ( Scheduler ) . toFlushAndYield ( [ 'Monkey' , 'onCommit ' ] ) ;
3532
+ expect ( onCommit ) . toHaveBeenCalledTimes ( 2 ) ;
3533
3533
3534
3534
// Once the promise resolves, we render the suspended view
3535
3535
await awaitableAdvanceTimers ( 20000 ) ;
3536
3536
expect ( Scheduler ) . toHaveYielded ( [ 'Promise resolved [Async]' ] ) ;
3537
- expect ( Scheduler ) . toFlushAndYield ( [
3538
- 'AsyncText [Async]' ,
3539
- 'onPostCommit' ,
3540
- ] ) ;
3537
+ expect ( Scheduler ) . toFlushAndYield ( [ 'AsyncText [Async]' , 'onCommit' ] ) ;
3541
3538
expect ( ReactNoop . getChildrenAsJSX ( ) ) . toEqual ( 'AsyncSync' ) ;
3542
- expect ( onPostCommit ) . toHaveBeenCalledTimes ( 3 ) ;
3539
+ expect ( onCommit ) . toHaveBeenCalledTimes ( 3 ) ;
3543
3540
3544
- call = onPostCommit . mock . calls [ 2 ] ;
3541
+ call = onCommit . mock . calls [ 2 ] ;
3545
3542
expect ( call [ 0 ] ) . toEqual ( 'test-profiler' ) ;
3546
3543
expect ( call [ 4 ] ) . toMatchInteractions (
3547
3544
ReactFeatureFlags . enableSchedulerTracing ? [ interaction ] : [ ] ,
0 commit comments