fix: Fix console errors about feature flags when running tests#21275
Merged
michael-s-molina merged 2 commits intoSep 1, 2022
Conversation
Codecov Report
@@ Coverage Diff @@
## master #21275 +/- ##
==========================================
- Coverage 66.44% 66.44% -0.01%
==========================================
Files 1784 1784
Lines 68234 68236 +2
Branches 7265 7265
==========================================
- Hits 45341 45336 -5
- Misses 21024 21030 +6
- Partials 1869 1870 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
michael-s-molina
approved these changes
Sep 1, 2022
Member
michael-s-molina
left a comment
There was a problem hiding this comment.
Thanks for the fix @codyml!
qfcwell
pushed a commit
to qfcwell/superset
that referenced
this pull request
May 12, 2026
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.
SUMMARY
#21201 added a console error if feature flags are read before initialization, but the Jest test environment doesn't include a feature flag initialization step, so all tests that render components that check feature flags were printing lots of these console errors (though still passing). This PR sets
featureFlagsto an empty object in the global window shim object used by Jest.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION