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

When mocha experiences a fatal error make sure that the grunt build fails #89

Closed EAE-BuildUser closed 9 years ago

EAE-BuildUser commented 9 years ago

Noticed this when we had a bad module reference in one of our spec files:

[4mRunning "mochaWebdriver:local" (mochaWebdriver) task [24m
Running webdriver tests against PhantomJS.
PhantomJS started.
[31m>> [39mMocha failed to run
[31m>> [39mError: Cannot find module '../../filter/filter' [31m
>> [39m  at Function.Module._resolveFilename (module.js:338:15) [31m
>> [39m  at Function.Module._load (module.js:280:25) [31m
>> [39m  at Module.require (module.js:364:17) [31m
>> [39m  at require (module.js:380:17) [31m
>> [39m  at Object.<anonymous> (/jenkins/workspace/BuzzDocs-Develop/node_modules/test-support/PAL/ToolbarList/UserNav/UserNavWithSubNavs.js:3:14) [31m

The error was logged to stdOut, but the build still passed. The build needs to fail in this condition.