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

Added Jest Environment on top of the test file #5245

Closed
wants to merge 1 commit into from

Conversation

arsho
Copy link

@arsho arsho commented Jan 8, 2018

Without this comment I could not run the test. I was getting:

FAIL  src/sum.test.js
  ● Test suite failed to run

    TypeError: environment.setup is not a function
      
      at node_modules/jest-runner/build/run_test.js:112:23

Test Suites: 1 failed, 1 total
Tests:       0 total
Snapshots:   0 total
Time:        0.395s
Ran all test suites.

Summary

Test plan

Without this comment I could not run the test. I was getting: 
```
FAIL  src/sum.test.js
  ● Test suite failed to run

    TypeError: environment.setup is not a function
      
      at node_modules/jest-runner/build/run_test.js:112:23

Test Suites: 1 failed, 1 total
Tests:       0 total
Snapshots:   0 total
Time:        0.395s
Ran all test suites.
```
@facebook-github-bot
Copy link
Contributor

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@cpojer
Copy link
Member

cpojer commented Jan 8, 2018

It seems like you are installing the wrong version of jest-environment-*. You need version 22 of all Jest dependencies, or version 21 of all Jest dependencies.

@cpojer cpojer closed this Jan 8, 2018
@arsho
Copy link
Author

arsho commented Jan 8, 2018

@cpojer ,
My package.json:

{
  "name": "jest-demo-test",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "react": "^16.2.0",
    "react-dom": "^16.2.0",
    "react-scripts": "1.0.17"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "jest",
    "eject": "react-scripts eject"
  },
  "devDependencies": {
    "jest": "^22.0.4"
  }
}

It seems I have Jest version 22.
Can you elaborate your comment regarding this?

Thank you

@SimenB
Copy link
Member

SimenB commented Jan 8, 2018

You cannot upgrade to jest 22 on your own when using CRA, see facebook/create-react-app#2639

@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants