@@ -16,7 +16,8 @@ if (__DEV__) {
1616 ReactFreshRuntime = require ( 'react-refresh/runtime' ) ;
1717 ReactFreshRuntime . injectIntoGlobalHook ( global ) ;
1818}
19- const ReactDOM = require ( 'react-dom' ) ;
19+ const ReactDOMClient = require ( 'react-dom/client' ) ;
20+ const act = require ( 'internal-test-utils' ) . act ;
2021
2122jest . resetModules ( ) ;
2223const ReactART = require ( 'react-art' ) ;
@@ -41,7 +42,7 @@ describe('ReactFresh', () => {
4142 }
4243 } ) ;
4344
44- it ( 'can update components managed by different renderers independently' , ( ) => {
45+ it ( 'can update components managed by different renderers independently' , async ( ) => {
4546 if ( __DEV__ ) {
4647 const InnerV1 = function ( ) {
4748 return < ReactART . Shape fill = "blue" /> ;
@@ -59,7 +60,10 @@ describe('ReactFresh', () => {
5960 } ;
6061 ReactFreshRuntime . register ( OuterV1 , 'Outer' ) ;
6162
62- ReactDOM . render ( < OuterV1 /> , container ) ;
63+ const root = ReactDOMClient . createRoot ( container ) ;
64+ await act ( ( ) => {
65+ root . render ( < OuterV1 /> ) ;
66+ } ) ;
6367 const el = container . firstChild ;
6468 const pathEl = el . querySelector ( 'path' ) ;
6569 expect ( el . style . color ) . toBe ( 'blue' ) ;
0 commit comments