ValentinH / jest-fail-on-console

Utility to make jest tests fail when console.error() or any other methods are used
MIT License
146 stars 21 forks source link

Jest exit code is still 0 when jest fails, causing Jenkins builds to be successful #42

Closed stanislavlevitt closed 9 months ago

stanislavlevitt commented 1 year ago

If all the assertions within a test pass, Jest will have an exit code of 0 despite a specific test being marked as fail due to a console error.

This in turn cause builds to be successful with failing tests.

Taking a quick look at this repo, I think you are causing the console messages, but not doing anything to jest itself, so the exit code is unchanged,

ValentinH commented 1 year ago

This library is just throwing when a console call is detected. It's weird because I'm pretty sure that the tests are failing if just a console method is called.

ValentinH commented 9 months ago

Closing as there was no answer for a while. Comment to re-open 😉