Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(clean): remove --env=jsdom as JSDOM is Jest's default #396

Merged
merged 1 commit into from
Dec 28, 2019

Conversation

agilgur5
Copy link
Collaborator

@agilgur5 agilgur5 commented Dec 27, 2019

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 node under-the-hood in v1 but I'm not really sure (did not investigate history any further). tsdx seemed to never default to node, so seems like it was always redundant in tsdx.

There's a separate question of whether to use node test environment in the default template, but a non-React library may still be a browser-based library, and therefore might still want to use jsdom.
I think using node is an optimization/option that should be left to the user; setting it to node by default would probably cause more confusion than optimization (and it may not shave off much time, if any, based on my experience at least).

- 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
@swyxio
Copy link
Collaborator

swyxio commented Dec 28, 2019

TIL, thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants