`react-scripts test` return code always zero

Viewed 597

Is there anyone know how to make yarn test (or npm test) in a react app return non-zero code when there is failed test

In my project, executing CI=true yarn test return

Test Suites: 10 failed, 10 total
Tests:       1 failed, 1 total
Snapshots:   0 total
Time:        1.736s
Ran all test suites.
Done in 2.34s.

All tests failed. But the command returned zero-code.

This make travis-ci unable to detect failed test

0 Answers
Related