sindresorhus / gulp-mocha

Run Mocha tests
MIT License
375 stars 91 forks source link

Fix tests in Node 8 #181

Closed danthegoodman closed 6 years ago

danthegoodman commented 7 years ago

Node 8 added error codes to error messages. The error message in node8 is now Uncaught AssertionError [ERR_ASSERTION]: false == true

I also changed the tester from t.true to t.regex. This was done so that future error messages become can more meaningful. I had a little bit of difficulty parsing the error before as all that was reported to me was "the value false was expected to be true".

The regular expression used to check for the assertion error is a little broad with the wildcard match before the colon. If you'd like a more specific one, I can change it to this:

t.regex(error.stdout, /throws after timeout|Uncaught AssertionError( \[ERR_ASSERTION])?: false == true/);