File tree Expand file tree Collapse file tree
packages/react-refresh/src/__tests__ Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -79,6 +79,12 @@ describe('ReactFresh', () => {
7979 return Component ;
8080 }
8181
82+ function patchSync ( version ) {
83+ const Component = version ( ) ;
84+ ReactFreshRuntime . performReactRefresh ( ) ;
85+ return Component ;
86+ }
87+
8288 function $RefreshReg$ ( type , id ) {
8389 ReactFreshRuntime . register ( type , id ) ;
8490 }
@@ -2470,7 +2476,7 @@ describe('ReactFresh', () => {
24702476 expect ( el . firstChild ) . toBe ( null ) ; // Offscreen content not flushed yet.
24712477
24722478 // Perform a hot update.
2473- await patch ( ( ) => {
2479+ patchSync ( ( ) => {
24742480 function Hello ( ) {
24752481 React . useLayoutEffect ( ( ) => {
24762482 Scheduler . log ( 'Hello#layout' ) ;
@@ -2509,7 +2515,7 @@ describe('ReactFresh', () => {
25092515 expect ( el . firstChild . style . color ) . toBe ( 'red' ) ;
25102516
25112517 // Hot reload while we're offscreen.
2512- await patch ( ( ) => {
2518+ patchSync ( ( ) => {
25132519 function Hello ( ) {
25142520 React . useLayoutEffect ( ( ) => {
25152521 Scheduler . log ( 'Hello#layout' ) ;
You can’t perform that action at this time.
0 commit comments