@@ -17,7 +17,7 @@ function ensureTestIdAttribute(element: HTMLElement) {
1717let activeActs = 0
1818
1919function setActEnvironment ( env : boolean | undefined ) : void {
20- ( globalThis as any ) . IS_REACT_ACT_ENVIRONMENT = env
20+ ; ( globalThis as any ) . IS_REACT_ACT_ENVIRONMENT = env
2121}
2222
2323function updateActEnvironment ( ) : void {
@@ -30,7 +30,7 @@ const _act = React.act || React.unstable_act
3030// we call act only when rendering to flush any possible effects
3131// usually the async nature of Vitest browser mode ensures consistency,
3232// but rendering is sync and controlled by React directly
33- const act = typeof _act !== 'function'
33+ const act : typeof React . act = typeof _act !== 'function'
3434 ? async ( cb : ( ) => unknown ) => { await cb ( ) }
3535 : async ( cb : ( ) => unknown ) => {
3636 activeActs ++
@@ -115,7 +115,7 @@ export async function render(
115115 } )
116116 }
117117
118- await act ( ( ) => {
118+ await act ( async ( ) => {
119119 root ! . render (
120120 strictModeIfNeeded ( wrapUiIfNeeded ( ui , WrapperComponent ) ) ,
121121 )
@@ -127,12 +127,12 @@ export async function render(
127127 locator : page . elementLocator ( container ) ,
128128 debug : ( el , maxLength , options ) => debug ( el , maxLength , options ) ,
129129 unmount : async ( ) => {
130- await act ( ( ) => {
130+ await act ( async ( ) => {
131131 root . unmount ( )
132132 } )
133133 } ,
134134 rerender : async ( newUi : React . ReactNode ) => {
135- await act ( ( ) => {
135+ await act ( async ( ) => {
136136 root . render (
137137 strictModeIfNeeded ( wrapUiIfNeeded ( newUi , WrapperComponent ) ) ,
138138 )
@@ -210,7 +210,7 @@ export async function renderHook<Props, Result>(renderCallback: (initialProps?:
210210
211211export async function cleanup ( ) : Promise < void > {
212212 for ( const { root, container } of mountedRootEntries ) {
213- await act ( ( ) => {
213+ await act ( async ( ) => {
214214 root . unmount ( )
215215 } )
216216 if ( container . parentNode === document . body ) {
0 commit comments