npm test and yarn test fail with no error message
See original GitHub issueIs 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
node -v
:v6.9.1
npm -v
: tested with3.10.8
,4.6.1
, and5.2.0
yarn --version
(if you use Yarn): 0.27.5npm ls react-scripts
(if you haven’t ejected):
client@0.1.0 H:\bitbucket\program\src\main\client
`-- react-scripts@1.0.7
- 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.
create-react-app myapp
andcd
into the directory- Without changing anything in the project, run
npm test
oryarn test
After Ejecting
create-react-app myapp
andcd
into the directory- Run
npm run eject
- Run
npm test
oryarn 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:
- Created 6 years ago
- Reactions:2
- Comments:15 (5 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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 addmaterial-design-icons
, but I did not use it.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 inreact-scripts@2
.Other issues are probably solved by above.