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

Error when running npm test or npm run lint-test #635

Closed
mainangethe opened this issue Mar 10, 2019 · 10 comments
Closed

Error when running npm test or npm run lint-test #635

mainangethe opened this issue Mar 10, 2019 · 10 comments

Comments

@mainangethe
Copy link

mainangethe commented Mar 10, 2019

I recently completed the Is Leap for Javascript.

  • I tried to run my tests with the command javascript npm test .
  • I went to the link provided by the CLI.
  • Expected: to see the results of my unit tests,
  • Actual: I got a Type Error.

cannot assign to read only property 'Symbol(Symbol.toStringTag)' of object

Here's my "exercism debug":

**** Debug Information ****
Exercism CLI Version: 2.3.0
Exercism CLI Latest Release: 2.3.0
OS/Architecture: ubuntu, x64
Build OS/Architecture /
Home Dir: /Users/ngethe
Config file: /Users/ngethe/.exercism.json
API Key: *******
Exercises Directory: /Users/ngethe/exercism/javascript
> exercism-javascript@0.0.0 test /home/ngethe/exercism/javascript/leap
> jest --no-cache ./*

**ERROR MESSAGE**
 FAIL  ./leap.spec.js
  ● Test suite failed to run

    TypeError: Cannot assign to read only property 'Symbol(Symbol.toStringTag)' of object '#<process>'

      at exports.default (node_modules/jest-util/build/create_process_object.js:15:34)

Test Suites: 1 failed, 1 total
Tests:       0 total
Snapshots:   0 total
Time:        0.444s
Ran all test suites matching /.\/README.md|.\/isLeap.js|.\/leap.spec.js|.\/node_modules|.\/package-lock.json|.\/package.json/i.

@mainangethe
Copy link
Author

tiny-error-screenshot

@tejasbubane
Copy link
Member

This is an issue with Node v11.11 - facebook/create-react-app#6591 For now there is no fix apart from downgrading node version.

@micalgenus
Copy link

The project does not seem to use create-react-app. The following was resolved in jest: jestjs/jest#8050

If you use the version of jest and Babel-jest at v24.2.0-alpha.0 or later, you can resolve it. The latest version of best is v24.3.1. 😄

@tejasbubane
Copy link
Member

@micalgenus Yes. This project does not use create-react-app and the issue was in Jest. I just happened to find that issue in create-react-app repo and used that issue link.

Alright so we need to update Jest. I tried doing the same after Jest 24 released recently and ran into all sorts of weird issues due to babel 7 (ref) I will give it a try again today.

@mainangethe
Copy link
Author

@micalgenus - I tried installing jest and babel-jest @ v24.2.0-alpha.0

And still getting an error. Now it's saying Cannot find module './leap' from 'leap.spec.js'
tiny-npm-jest- -babel-v24 2-failing-16032019

@SleeplessByte
Copy link
Member

SleeplessByte commented Mar 16, 2019

And are you certain there is a leap.js file in that directory? Normally you'll have to create this file and write the code in there.

@SleeplessByte SleeplessByte changed the title Trying to run npm test or npm run lint-test and getting same error: cannot assign to read only property 'Symbol(Symbol.toStringTag)' of object Error when running npm test or npm run lint-test Mar 19, 2019
@SleeplessByte
Copy link
Member

Resolved in Node 11.12

@tejasbubane
Copy link
Member

tejasbubane commented Mar 25, 2019

@mainangethe Please fetch new version of the exercise and try again. Reopen this issue if you are still seeing the error. Thanks!

@caledrummond90
Copy link

npm run build
chromium tests/testsuite.html
npm run lint

@SleeplessByte
Copy link
Member

@caledrummond90 I don't know why you posted this in this issue, but there is no build script in exercism/javascript, and no testsuite.html.

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

5 participants