- Companion:
- object
Type members
Value members
Concrete methods
When writing UI tests, tasks like rendering, user events, or data fetching can be considered as "units" of interaction with a user interface. React provides a helper called act() that makes sure all updates related to these "units" have been processed and applied to the DOM before you make any assertions:
When writing UI tests, tasks like rendering, user events, or data fetching can be considered as "units" of interaction with a user interface. React provides a helper called act() that makes sure all updates related to these "units" have been processed and applied to the DOM before you make any assertions:
act {
// render components
}
// make assertions
This helps make your tests run closer to what real users would experience when using your application.
When writing UI tests, tasks like rendering, user events, or data fetching can be considered as "units" of interaction with a user interface. React provides a helper called act() that makes sure all updates related to these "units" have been processed and applied to the DOM before you make any assertions:
When writing UI tests, tasks like rendering, user events, or data fetching can be considered as "units" of interaction with a user interface. React provides a helper called act() that makes sure all updates related to these "units" have been processed and applied to the DOM before you make any assertions:
await act(async () => {
// render components
});
// make assertions
This helps make your tests run closer to what real users would experience when using your application.
Concrete fields
Implicits
Inherited implicits
- Inherited from:
- ReactTestUtilExtensions
- Inherited from:
- ReactTestUtilExtensions1