Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrap mount renderer render with reactTestUtils.act() #2034

Merged
merged 3 commits into from Mar 10, 2019

Conversation

3 participants
@chenesan
Copy link
Contributor

chenesan commented Mar 6, 2019

This PR wrap the render function of mount renderer with act() so that use cases with useEffect would work. The test is the test case in https://github.com/threepointone/react-act-examples/blob/master/README.md#effects .

chenesan added some commits Mar 6, 2019

@ljharb ljharb added this to v16.8+: Hooks in React 16 Mar 7, 2019

@ljharb

ljharb approved these changes Mar 9, 2019

Copy link
Member

ljharb left a comment

Thanks, this is great!

@ljharb ljharb force-pushed the chenesan:react-test-util-act branch 2 times, most recently from 4926f6e to 35ec8fb Mar 10, 2019

@ljharb ljharb merged commit 35ec8fb into airbnb:master Mar 10, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@pgangwani

This comment has been minimized.

Copy link

pgangwani commented Mar 10, 2019

@chenesan : Glad to see this PR merged.

ljharb added a commit that referenced this pull request Mar 13, 2019

[enzyme-adapter-react-16] v1.11.0
 - [new] Wrap renders in `TestUtils.act` (#2034)
 - [fix] `shallow`: Mock sCU if gDSFP defined in shallow renderer rerender (#1981)
 - [fix] add `hasShouldComponentUpdateBug` to gDSFP lifecycles option (#1981)
 - [deps] update `react-is`, `enzyme-adapter-utils`, `prop-types`

ljharb added a commit that referenced this pull request Mar 14, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.