(clean): remove --env=jsdom as JSDOM is Jest's default#396
Merged
Conversation
- the React template and docs for it had --env=jsdom explicitly set, but there's no need to do this, as Jest uses JSDOM by default already - setting it a second time in CLI also overrides any custom configs
Collaborator
|
TIL, thank you |
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.
the React template and docs for it had --env=jsdom explicitly set,
but there's no need to do this, as Jest uses JSDOM by default already
setting it a second time in CLI also overrides any custom configs
Docs seemed to be introduced in 4296413 and template in #68 . This seems to have matched the templating of CRA v1, but this was changed in CRA v2. I'm guessing CRA may have defaulted to
nodeunder-the-hood in v1 but I'm not really sure (did not investigate history any further).tsdxseemed to never default tonode, so seems like it was always redundant intsdx.There's a separate question of whether to use
nodetest environment in the default template, but a non-React library may still be a browser-based library, and therefore might still want to usejsdom.I think using
nodeis an optimization/option that should be left to the user; setting it tonodeby default would probably cause more confusion than optimization (and it may not shave off much time, if any, based on my experience at least).