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.

Jest: "Test run was interrupted." happens with npm run test

See original GitHub issue

Is this a bug report?

Yes

Can you also reproduce the problem with npm 4.x?

Yes

Which terms did you search for in User Guide?

Environment

  1. node -v: 6.9.1
  2. npm -v: 4.6.1
  3. npm ls react-scripts (if you haven’t ejected): 1

Then, specify:

  1. Operating system: Windows 8.1

Steps to Reproduce

(Write your steps here:)

  1. npm run test

Expected Behavior

Unit tests would execute

Actual Behavior

Consistently get:

“Test run was interrupted.”

Reproducible Demo

Tough to come up with a case. I did notice that adding --runInBand seems to work fine (though slower).

I’m thinking this is due to my Anti Virus, and is likely an issue with Jest, however, since everyone here works with similar configurations, I figured I’d start here before posting over there.

Unfortunately, I can’t prove out my AV theory, as I need my IT team to allow me to stop it.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:25 (11 by maintainers)

github_iconTop GitHub Comments

5reactions
ArmorDarkscommented, Jul 31, 2017

Yeap, worth a try.

I’m not sure that I will be able to provide good track down of issue, though, since issue seems to be sporadic and happens only sometimes, and that “sometimes” usually starts to happen only after Jest works for a while and some good amount of watch events happens.

5reactions
markguckiancommented, Jul 10, 2017

Looks like Cmder/ConEmu is triggering an [Enter] key somehow which is setting the ‘interrupted’ state in testWatcher to true.

(jest-cli/build/watch.js) cra-newlines

(jest-cli/build/constants.js) cra-newlines-enter

(Using react-scripts 1.0.7)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Watch and rerun Jest JS tests - npm - Stack Overflow
An important thing to point out is that nodemon will interrupt the tests and start again if a change happens while the tests...
Read more >
Troubleshooting - Jest
Troubleshooting. Uh oh, something went wrong? Use this guide to resolve issues with Jest. Tests are Failing and You Don't Know Why​.
Read more >
jest - npm
Instant Feedback: Failed tests run first. Fast interactive mode can switch between running all tests or only test files related to changed ...
Read more >
Jest Testing like a Pro - Tips and tricks
If the methods you want to test are asynchronous, be it callbacks, promises or async, it is not a problem with Jest. The...
Read more >
How to fix broken Jest in React 16.4.1 with CRA and debug ...
Turns out it's something with the react-scripts portion of create-react-app being out of date on its version of the Jest Testing API. I...
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