This grunt task will never fail (process exit with non-zero) if mocha test fails. which breaks the actual usage in a CI environment. For instance, command $ grunt mochaWebdriver will always exit with status 0. which is unexpected.
Then I found it never touches err parameter inside the function onTestFinish, which means mocha test errors are ignored. so I just simply report the mocha test result out.
I didn't provide parameter for callback function of quit because it kills phantom in anyway or shows "One or more tests on (Selenium|Sauce Labs) failed.". which should be caused by mocha test failure(s).
This grunt task will never fail (process exit with non-zero) if mocha test fails. which breaks the actual usage in a CI environment. For instance, command
$ grunt mochaWebdriver
will always exit with status 0. which is unexpected.Then I found it never touches
err
parameter inside the functiononTestFinish
, which means mocha test errors are ignored. so I just simply report the mocha test result out.I didn't provide parameter for callback function of
quit
because it kills phantom in anyway or shows "One or more tests on (Selenium|Sauce Labs) failed.". which should be caused by mocha test failure(s).