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 and yarn test fail with no error message

See original GitHub issue

Is this a bug report?

Yes.

Can you also reproduce the problem with npm4.x?

Yes, I tried this with 3.10.8, 4.6.1, and 5.2.0. I deleted the node_modules folder and ran npm cache clean with each version as well.

Environment

  1. node -v: v6.9.1
  2. npm -v: tested with 3.10.8, 4.6.1, and 5.2.0
  3. yarn --version (if you use Yarn): 0.27.5
  4. npm ls react-scripts (if you haven’t ejected):
client@0.1.0 H:\bitbucket\program\src\main\client
`-- react-scripts@1.0.7
  1. Operating system: Windows 7 Enterprise

Steps to Reproduce

The testing script will fail in both unejected app whose development is ongoing, and a newly created app even afer ejecting.

  1. create-react-app myapp and cd into the directory
  2. Without changing anything in the project, run npm test or yarn test

After Ejecting

  1. create-react-app myapp and cd into the directory
  2. Run npm run eject
  3. Run npm test or yarn test

Expected Behavior

I expect the Jest test runner to start and watch for file changes.

Actual Behavior

H:\bitbucket\program\src\main\client
λ npm test

> client@0.1.0 test H:\bitbucket\program\src\main\client
> react-scripts test --env=jsdom

npm ERR! Test failed.  See above for more details.

H:\bitbucket\program\src\main\client
λ yarn test
yarn test v0.27.5
$ react-scripts test --env=jsdom
error Command failed with exit code 3221226356.

An npm-debug.log file will sometimes be created but it is always empty.

Reproducible Demo

I cannot share a demo or the actual project unfortunately, but I suspect it is an issue with my environment. The start, run, and build scripts all work perfectly by the way.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:15 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
minossscommented, Aug 4, 2017

I’m sorry I missing a step, the problem is material-design-icons. I’m remove all dependencies and add one by one, test fail after add material-design-icons, but I did not use it.

0reactions
Timercommented, Aug 16, 2017

The issue @jorgegonzalez having is an obscure (and weird!) error that should be filed directly with Jest to figure out the problem.

The EMFILE error is caused by too many open files on your system; this will be fixed in the next Jest upgrade coming in react-scripts@2.

Other issues are probably solved by above.

Read more comments on GitHub >

github_iconTop Results From Across the Web

react app yarn test fails with exit code 1, while yarn start ...
Can you try this -> https://github.com/facebook/create-react-app/issues/11792#issuecomment-998851765. Looks like there is an issue with node ...
Read more >
start-server-and-test
Starts server, waits for URL, then runs test command; ... HTTP(S) error for http://localhost:3000 Error: Request failed with status code 404 ...
Read more >
jest-fail-on-console
Jest doesn't fail the tests when there is a console.error . In large codebase, we can end up with the test output overloaded...
Read more >
Jest CLI Options
If you run Jest via npm test , you can still use the command line arguments ... Make calling deprecated APIs throw helpful...
Read more >
Testing Extensions - Visual Studio Code
In the generated extension, you can use npm run test or yarn test to run the ... catch (err) { console.error(err); console.error('Failed to...
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