We run unit and acceptance (e2e) tests on Jenkins using Karma and Grunt. Karma produces JUnit reports using the karma-junit-reporter, and we've configured Jenkins to set the build as unstable (yellow) if test failures are found in these report files.
The problem is that whenever a test fails, Karma and Grunt exits with a non-zero exit code and this makes the build failed (red). Can this behavior be altered?
I'd prefer not to run Grunt with --force, because I still want a failed build when the tests cannot be executed or when other tasks fail.