Allow reading default feature flags from bundle tests#13629
Merged
gaearon merged 1 commit intofacebook:masterfrom Sep 12, 2018
Merged
Allow reading default feature flags from bundle tests#13629gaearon merged 1 commit intofacebook:masterfrom
gaearon merged 1 commit intofacebook:masterfrom
Conversation
Details of bundled changes.Comparing: 7204b63...44118e3 schedule
Generated by 🚫 dangerJS |
Simek
pushed a commit
to Simek/react
that referenced
this pull request
Oct 25, 2018
jetoneza
pushed a commit
to jetoneza/react
that referenced
this pull request
Jan 23, 2019
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.
I want to run some tests both in Fire and normal modes (#13628).
But for that I need tests to switch on
ReactFeatureFlagsand determine the expected behavior based on that. And this doesn't work in bundle tests so I'd have to make them internal.I don't want to make those tests internal. So instead I'm making a readonly version of
ReactFeatureFlagsavailable to bundle tests. That's sufficient to know in which mode we're running. If you attempt to write to it (as some our tests which need to stay internal do), this will throw.I could have used something like
process.envfor this instead. But it felt more confusing to me to have different ways to read a feature flag.