Move IS_JEST_ENVIRONMENT src/test -> src/utils#5655
Merged
chandlerprall merged 2 commits intoelastic:mainfrom Feb 22, 2022
Merged
Move IS_JEST_ENVIRONMENT src/test -> src/utils#5655chandlerprall merged 2 commits intoelastic:mainfrom
chandlerprall merged 2 commits intoelastic:mainfrom
Conversation
cee-chen
approved these changes
Feb 22, 2022
Contributor
cee-chen
left a comment
There was a problem hiding this comment.
Looks good to me! Long term I think we should consider moving away from IS_JEST_ENVIRONMENT to testenv mocks, but if/when we do we can just delete the entire util if only datagrid is using it
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5655/ |
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
Fixes #5605
Traditionally, the src/test directory was meant to include helpers specific to unit tests, and while these are included in EUI's npm distribution, only importable through
@elastic/eui/es/testor@elastic/eui/lib/test. When I addedIS_JEST_ENVIRONMENTfor the data grid checks, I added it to the src/test directory even though it is consumed by non-test source code, breaking that tradition. It's moved around a bit since then, but has made its way back to src/test which broke the environment described in #5606.This PR moves
IS_JEST_ENVIRONMENTto src/utils to align with the rest of the codebase's organization. I also added a readme file for the test directory to re-set those expectations and document the baseline of those helpers (most of them, I omitted a few that we should probably just delete, but didn't want to conflate this change).Skipping the changelog on this because it doesn't feel impactful to the setups we specifically support, but that's only my opinion.
Checklist
- [ ] Check against all themes for compatibility in both light and dark modes- [ ] Checked in mobile- [ ] Checked in Chrome, Safari, Edge, and Firefox- [ ] Props have proper autodocs and playground toggles- [ ] Checked Code Sandbox works for any docs examples- [ ] Added or updated jest and cypress tests- [ ] Checked for accessibility including keyboard-only and screenreader modes- [ ] A changelog entry exists and is marked appropriately