Detecting when there are warnings

19 views
Skip to first unread message

Paul Jolly

unread,
Sep 9, 2015, 1:07:06 PM9/9/15
to karma-users

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.227:INFO [karma]: Karma v0.13.9 server started at http://localhost:9876/
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
    at XMLHttpRequest.xhr.onreadystatechange (http://localhost:9876/xhr_typed.ts:x:y)'
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
Reply all
Reply to author
Forward
0 new messages