When a test fails within Jest it always exits throwing an npm error "errno 1". I find this is be rather ugly and makes it seem rather alarming. Is this standard for Jest? I would much prefer to just see the first 5 lines.
Test Suites: 1 failed, 1 passed, 2 total
Tests: 1 failed, 3 passed, 4 total
Snapshots: 0 total
Time: 41.881s
Ran all test suites.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] test: `jest`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] test script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/nicklee/.npm/_logs/2019-04-30T19_33_00_584Z-debug.log
Actually, it's not an issue, jest exits with status code 1 when the test case failed.We get that error when the any test or spec file fails then it exits with status 1(Exit status 1
) and when it successfully passed the all test cases then it exits with 0.
That is usual behavior of node based CLI
tools.Check this closed issue too
But you can use jest-html reporter
or jest-stare
package to find which suite failed while running as a workaround.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With