I want my CI server to fail a build when there are warnings generated in a test run, e.g. I would want the following to fail:
$ xvfb-run karma start --single-run --browsers Chrome
09 09 2015 18:01:29.233:INFO [launcher]: Starting browser Chrome
09 09 2015 18:01:29.662:INFO [Chrome 46.0.2490 (Linux 0.0.0)]: Connected on socket xxxx with id 4140817
09 09 2015 18:01:30.516:WARN [web-server]: 404: /a/b/c/GET.json
ERROR: 'Potentially unhandled rejection [2] Error: XHR Call FailedNot Found
Chrome 46.0.2490 (Linux 0.0.0): Executed 226 of 228 (skipped 2) SUCCESS (1.043 secs / 0.972 secs)
$ echo $?
0
The standard way of doing this would be to exit with an exit bit mask, but I couldn't find any documentation to this effect and as you can see the exit code is 0.
Can anyone help?
Thanks