File tree 1 file changed +8
-2
lines changed
packages/react-refresh/src/__tests__ 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -79,6 +79,12 @@ describe('ReactFresh', () => {
79
79
return Component ;
80
80
}
81
81
82
+ function patchSync ( version ) {
83
+ const Component = version ( ) ;
84
+ ReactFreshRuntime . performReactRefresh ( ) ;
85
+ return Component ;
86
+ }
87
+
82
88
function $RefreshReg$ ( type , id ) {
83
89
ReactFreshRuntime . register ( type , id ) ;
84
90
}
@@ -2470,7 +2476,7 @@ describe('ReactFresh', () => {
2470
2476
expect ( el . firstChild ) . toBe ( null ) ; // Offscreen content not flushed yet.
2471
2477
2472
2478
// Perform a hot update.
2473
- await patch ( ( ) => {
2479
+ patchSync ( ( ) => {
2474
2480
function Hello ( ) {
2475
2481
React . useLayoutEffect ( ( ) => {
2476
2482
Scheduler . log ( 'Hello#layout' ) ;
@@ -2509,7 +2515,7 @@ describe('ReactFresh', () => {
2509
2515
expect ( el . firstChild . style . color ) . toBe ( 'red' ) ;
2510
2516
2511
2517
// Hot reload while we're offscreen.
2512
- await patch ( ( ) => {
2518
+ patchSync ( ( ) => {
2513
2519
function Hello ( ) {
2514
2520
React . useLayoutEffect ( ( ) => {
2515
2521
Scheduler . log ( 'Hello#layout' ) ;
You can’t perform that action at this time.
0 commit comments