react/packages/jest-react
Andrew Clark 163e81c1f8
Support disabling spurious act warnings with a global environment flag (#22561)
* Extract `act` environment check into function

`act` checks the environment to determine whether to fire a warning.
We're changing how this check works in React 18. As a first step, this
refactors the logic into a single function. No behavior changes yet.

* Use IS_REACT_ACT_ENVIRONMENT to disable warnings

If `IS_REACT_ACT_ENVIRONMENT` is set to `false`, we will suppress
any `act` warnings. Otherwise, the behavior of `act` is the same as in
React 17: if `jest` is defined, it warns.

In concurrent mode, the plan is to remove the `jest` check and only warn
if `IS_REACT_ACT_ENVIRONMENT` is true. I have not implemented that
part yet.
2021-10-18 08:27:26 -07:00
..
npm Jest + test renderer helpers for concurrent mode (#13751) 2018-10-03 18:37:41 -06:00
src Support disabling spurious act warnings with a global environment flag (#22561) 2021-10-18 08:27:26 -07:00
README.md Jest + test renderer helpers for concurrent mode (#13751) 2018-10-03 18:37:41 -06:00
index.js Jest + test renderer helpers for concurrent mode (#13751) 2018-10-03 18:37:41 -06:00
package.json Bump versions for 17 (#20062) 2020-10-20 21:41:18 +01:00

README.md

jest-react

Jest matchers and utilities for testing React Test Renderer.