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

Jest environment.teardown error with CRA (conflicting versions) #59

Closed
v1adko opened this issue Aug 16, 2018 · 1 comment
Closed

Jest environment.teardown error with CRA (conflicting versions) #59

v1adko opened this issue Aug 16, 2018 · 1 comment

Comments

@v1adko
Copy link

v1adko commented Aug 16, 2018

Note:

This is not an issue per se, but more of a heads-up/unofficial docs for people who encounter the same problem. However this can spark some discussions on how to manage versions of the external (app) and internal (toolbox) dependencies.

Env:

  • kcd-scripts ^0.42.1:
  • node: 8.11.3
  • yarn 1.9.4

What you did:

Use default pre-commit on CRA based repo.

What happened:

TypeError: environment.teardown is not a function

screen shot 2018-08-17 at 12 15 00 am

Problem description:

The issue is realated to the fact that CRA does not allow conflicting Jest versions.

Related issues for some background: jest#6393, jest#5119

Suggested solution:

Add lint-staged entry in your package.json, ultimately overwriting actions on pre-commit hook, something along these lines

  "lint-staged": {
    "*.js": [
      "yarn format",
      "yarn lint",
      "git add"
    ]
  },
@kentcdodds
Copy link
Owner

Yeah, not much we can do about this I'm afraid. Thanks for making it googleable though!

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

No branches or pull requests

2 participants