File tree 2 files changed +12
-2
lines changed
2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 50
50
"@reach/router" : " ^1.3.3" ,
51
51
"@testing-library/jest-dom" : " ^5.10.1" ,
52
52
"@types/react-dom" : " ^16.9.8" ,
53
+ "@types/scheduler" : " ^0.16.1" ,
53
54
"dotenv-cli" : " ^3.1.0" ,
54
55
"dtslint" : " 3.6.12" ,
55
56
"kcd-scripts" : " ^6.2.3" ,
61
62
},
62
63
"peerDependencies" : {
63
64
"react" : " *" ,
64
- "react-dom" : " *"
65
+ "react-dom" : " *" ,
66
+ "scheduler" : " *"
65
67
},
66
68
"eslintConfig" : {
67
69
"extends" : " ./node_modules/kcd-scripts/eslint.js" ,
Original file line number Diff line number Diff line change
1
+ import {
2
+ unstable_scheduleCallback as scheduleCallback ,
3
+ unstable_NormalPriority as normalPriority ,
4
+ } from 'scheduler'
1
5
/* istanbul ignore file */
2
6
// the part of this file that we need tested is definitely being run
3
7
// and the part that is not cannot easily have useful tests written
@@ -59,7 +63,11 @@ export default function flushMicroTasks() {
59
63
jest . advanceTimersByTime ( 0 )
60
64
resolve ( )
61
65
} else {
62
- enqueueTask ( resolve )
66
+ scheduleCallback ( normalPriority , ( ) => {
67
+ enqueueTask ( ( ) => {
68
+ resolve ( )
69
+ } )
70
+ } )
63
71
}
64
72
} ,
65
73
}
You can’t perform that action at this time.
0 commit comments