jmreidy / grunt-mocha-webdriver

Grunt task to run Mocha tests against a WebDriver source - either PhantomJS or Sauce Labs
MIT License
36 stars 17 forks source link

report mocha test failures to correct test strategy #55

Closed shawnzhu closed 10 years ago

shawnzhu commented 10 years ago

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).

saadtazi commented 10 years ago

+1 for making the grunt task fail if one or more tests fail.