question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error when running `npm test` or `npm run lint-test`

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
tejasbubanecommented, Mar 11, 2019

@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.

0reactions
SleeplessBytecommented, Dec 16, 2020

@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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to prevent npm run lint from fixing errors automatically?
I have a GitHub action workflow checking the code style and using npm run lint is wrong because the workflow fixes the code...
Read more >
npm ERR! Missing script: "lint" [Solved] | bobbyhadz
If you try to run the command from a different directory, it won't find your package.json file and the Missing script: "lint" npm...
Read more >
NPM — How to Run ESLint --fix From npm Script - Future Studio
A typical command is to run the test suite for the project. ... to the ESLint fix command, you may lint your code...
Read more >
Problem to run tests with command 'npm run test' before code ...
Hi @plcgi1 – welcome to Discuss! ... This seems to indicate that on Node 17 you'll get that DOMException error you are seeing,...
Read more >
ESLint - npm
Make sure your plugins (and ESLint) are both in your project's package. · Make sure you have run npm install and all your...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found