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

SyntaxError: Identifier 'jest' has already been declared #1319

Closed
cnolimit opened this issue Dec 24, 2016 · 6 comments
Closed

SyntaxError: Identifier 'jest' has already been declared #1319

cnolimit opened this issue Dec 24, 2016 · 6 comments

Comments

@cnolimit
Copy link

cnolimit commented Dec 24, 2016

If you are reporting a bug, please fill in below. Otherwise feel free to remove this template entirely.

Can you reproduce the problem with latest npm?

Yes after updating to the latest version the issue still occurs

###Can you still reproduce it?

Yes issue still occurs

Description

An issue with running test using jest v18.0.0

Expected behavior

The declared variable within the test.js file would be the first instance, or the jest global variable to be available within the test.js

Actual behavior

Error is logged, stating that jest has already been declared
Screen Shot 2016-12-24 at 20.47.24.png

Environment

Run these commands in the project folder and fill in their results:

  1. npm ls react-scripts (if you haven’t ejected):
  2. node -v7.3.0:
  3. npm -3.10.10:

Then, specify:

  1. Operating system: macOs Sierra
  2. Browser and version: Chrome Version 55.0.2883.95 (64-bit)

Reproducible Demo

To re-create the issue;

  • run create-react-app
  • npm run eject
  • update jest version to 18.0.0
  • npm run test
@gaearon
Copy link
Contributor

gaearon commented Dec 24, 2016

Can you provide the relevant code?

@bondz
Copy link
Contributor

bondz commented Dec 24, 2016

See #1311

@cnolimit
Copy link
Author

Great! thanks all working now!

@gaearon
Copy link
Contributor

gaearon commented Dec 24, 2016

Could you clarify what was broken and how #1311 fixes this?

@bondz
Copy link
Contributor

bondz commented Dec 24, 2016

@gaearon jest@18 tries to run the file scripts/test.js as a test. It is configured to look for test files in src/, which it now also matches to scr/* making it look in the scripts folder.

@gaearon
Copy link
Contributor

gaearon commented Dec 24, 2016

Aaaah. Thanks for explaining.

@gaearon gaearon closed this as completed Dec 24, 2016
tyleryasaka added a commit to OriginProtocol/origin that referenced this issue Apr 18, 2018
Before this was failing on jest errors. This fixes the script so that it doesn't fail. (There are still no tests.)

We were getting this error: facebook/create-react-app#1319
tyleryasaka added a commit to OriginProtocol/origin that referenced this issue May 3, 2018
Before this was failing on jest errors. This fixes the script so that it doesn't fail. (There are still no tests.)

We were getting this error: facebook/create-react-app#1319
@lock lock bot locked and limited conversation to collaborators Jan 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants