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.

'npm test' command hangs/doesn't exit

See original GitHub issue

Hello, I’m having an issue executing tests in my terminal. When I type in npm test, the test will start to run, and then it never exits – it just hangs there. I have to keep canceling the test with ^C. After doing some googling this morning I uninstalled and reinstalled npm for node, updated yarn, jest, and homebrew.

However, none of these actions have solved my issue. I just want to be able to run my tests smoothly again and focus on learning instead of troubleshooting. Can anybody help me out?

Here is the full output on my terminal after running a test:

> exercism-javascript@2.1.0 test /Users/bobbychicano/Exercism/javascript/resistor-color-duo
> jest ./*

 FAIL  ./resistor-color-duo.spec.js
  Resistor Colors
    ✕ Brown and black (2 ms)
    ○ skipped Blue and grey
    ○ skipped Yellow and violet
    ○ skipped Orange and orange
    ○ skipped Ignore additional colors

  ● Resistor Colors › Brown and black

    Remove this statement and implement this function

      5 | 
      6 | export const decodedValue = () => {
    > 7 |   throw new Error("Remove this statement and implement this function");
        |         ^
      8 | };
      9 | 

      at decodedValue (resistor-color-duo.js:7:9)
      at Object.<anonymous> (resistor-color-duo.spec.js:5:12)

Test Suites: 1 failed, 1 total
Tests:       1 failed, 4 skipped, 5 total
Snapshots:   0 total
Time:        1.08 s
Ran all test suites matching /.\/README.md|.\/babel.config.js|.\/node_modules|.\/package-lock.json|.\/package.json|.\/resistor-color-duo.js|.\/resistor-color-duo.spec.js|.\/yarn.lock/i.

Thank you.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:13 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
bobbychicanocommented, Nov 20, 2020

Quick update guys:

I’ve moved on from the exercises I was having trouble with. I added --forceExit in the package.json file so that I could get through them.

I’m currently on the ‘triangle’ exercise and running npm test works smoothly and does not hang.

Thanks y’all for having taken the time to look into this.

1reaction
NobbZcommented, Nov 9, 2020

@NobbZ you have any ideas? Seen this issue on gitter?

Sorry beeing late, just realised this in my inbox by accident…

No, so far this behaviour has not been mentioned in the gitter, and I even asked an ex coworker (the only one I know im my proximity who has done JS for quite a while now) if he had observed something like this before, though he hasn’t as well.

Read more comments on GitHub >

github_iconTop Results From Across the Web

npm-test - npm Docs
Test a package. ... npm-test. Test a package. Select CLI Version: ... This runs a predefined command specified in the "test" property of...
Read more >
react-scripts@3.0.0 test command hangs #6899 - GitHub
and the process hangs (doesn't exits) ... scripts: "test:ci": "react-scripts test --no-watchman", and run npm run test:ci in Jenkins ...
Read more >
npm test -- --coverage never exits - node.js - Stack Overflow
Show activity on this post. -- --coverage part won't work, and should use one of the commands below to set CI to true...
Read more >
How to exit npm test in Bamboo Spec plan?
I'm running npm run test in my Bamboo Specs. The test runs fine but after it completes, the job just stops and hangs....
Read more >
Testing with NPM – three.js docs
Tests can be run on the command line, or by automated CI tools like Travis. The short version. If you're comfortable with node...
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