fix: test utils, only use act when in an act environment#668
Merged
thebuilder merged 1 commit intothebuilder:mainfrom Apr 8, 2024
Merged
fix: test utils, only use act when in an act environment#668thebuilder merged 1 commit intothebuilder:mainfrom
thebuilder merged 1 commit intothebuilder:mainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Contributor
Author
|
looks like I have to provide a type sig for global but pending that change would you be open to this approach? |
4c25f65 to
3c515e7
Compare
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
Owner
|
Looks good, and makes sense! |
Owner
|
🎉 This PR is included in version 9.8.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
when I try to turn off act warnings via
global.IS_REACT_ACT_ENVIRONMENT = falseI get warnings that act is being used in a non-act environment. I took this PR's approach from from React testing library, who explicitly check for .IS_REACT_ACT_ENVIRONMENT to be true before using act.Example:
https://github.com/testing-library/react-testing-library/blob/4e10ba3a788f6f66287dab5bb4a09f658664ec50/src/act-compat.js#L27