@@ -16,7 +16,8 @@ if (__DEV__) {
16
16
ReactFreshRuntime = require ( 'react-refresh/runtime' ) ;
17
17
ReactFreshRuntime . injectIntoGlobalHook ( global ) ;
18
18
}
19
- const ReactDOM = require ( 'react-dom' ) ;
19
+ const ReactDOMClient = require ( 'react-dom/client' ) ;
20
+ const act = require ( 'internal-test-utils' ) . act ;
20
21
21
22
jest . resetModules ( ) ;
22
23
const ReactART = require ( 'react-art' ) ;
@@ -41,7 +42,7 @@ describe('ReactFresh', () => {
41
42
}
42
43
} ) ;
43
44
44
- it ( 'can update components managed by different renderers independently' , ( ) => {
45
+ it ( 'can update components managed by different renderers independently' , async ( ) => {
45
46
if ( __DEV__ ) {
46
47
const InnerV1 = function ( ) {
47
48
return < ReactART . Shape fill = "blue" /> ;
@@ -59,7 +60,10 @@ describe('ReactFresh', () => {
59
60
} ;
60
61
ReactFreshRuntime . register ( OuterV1 , 'Outer' ) ;
61
62
62
- ReactDOM . render ( < OuterV1 /> , container ) ;
63
+ const root = ReactDOMClient . createRoot ( container ) ;
64
+ await act ( ( ) => {
65
+ root . render ( < OuterV1 /> ) ;
66
+ } ) ;
63
67
const el = container . firstChild ;
64
68
const pathEl = el . querySelector ( 'path' ) ;
65
69
expect ( el . style . color ) . toBe ( 'blue' ) ;
0 commit comments