File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -55,13 +55,14 @@ try {
55
55
'if you encounter this warning.' ,
56
56
)
57
57
}
58
-
59
58
}
60
59
}
61
60
62
- const isModernScheduleCallbackSupported = Scheduler && satisfies ( React . version , '>16.8.6' , {
63
- includePrerelease : true ,
64
- } )
61
+ const isModernScheduleCallbackSupported =
62
+ Scheduler &&
63
+ satisfies ( React . version , '>16.8.6' , {
64
+ includePrerelease : true ,
65
+ } )
65
66
66
67
function scheduleCallback ( cb ) {
67
68
const NormalPriority = Scheduler
@@ -86,6 +87,9 @@ export default function flushMicroTasks() {
86
87
// reproduce the problem, so there's no test for it. But it works!
87
88
jest . advanceTimersByTime ( 0 )
88
89
resolve ( )
90
+ } else if ( Scheduler && Scheduler . unstable_flushAll ) {
91
+ Scheduler . unstable_flushAll ( )
92
+ enqueueTask ( resolve )
89
93
} else {
90
94
scheduleCallback ( ( ) => enqueueTask ( resolve ) )
91
95
}
Original file line number Diff line number Diff line change 1
1
import '@testing-library/jest-dom/extend-expect'
2
+ jest . mock ( 'scheduler' , ( ) => jest . requireActual ( 'scheduler/unstable_mock' ) )
You can’t perform that action at this time.
0 commit comments