add ability to assert just an error instead of an error message in tests

This commit is contained in:
Sebastian McKenzie
2015-01-06 10:38:28 +11:00
parent fd6704ac25
commit 1b85607d7d

View File

@@ -129,7 +129,7 @@ module.exports = function (suiteOpts, taskOpts, dynamicOpts) {
delete task.options.throws;
assert.throws(runTask, function (err) {
return err.message.indexOf(throwMsg) >= 0;
return throwMsg === true || err.message.indexOf(throwMsg) >= 0;
});
} else {
runTask();