Comparing version 0.8.2 to 0.8.3
@@ -371,3 +371,6 @@ // Load modules | ||
var msgs = Array.prototype.slice.call(arguments, 1); | ||
msgs = msgs.map(function (msg) { return typeof msg === 'string' ? msg : JSON.stringify(msg); }); | ||
msgs = msgs.map(function (msg) { | ||
return typeof msg === 'string' ? msg : msg instanceof Error ? msg.message : JSON.stringify(msg); | ||
}); | ||
throw new Error(msgs.join(' ') || 'Unknown error'); | ||
@@ -374,0 +377,0 @@ }; |
{ | ||
"name": "hoek", | ||
"description": "General purpose node utilities", | ||
"version": "0.8.2", | ||
"version": "0.8.3", | ||
"author": "Eran Hammer <eran@hueniverse.com> (http://hueniverse.com)", | ||
@@ -6,0 +6,0 @@ "contributors":[ |
@@ -746,2 +746,13 @@ // Load modules | ||
}); | ||
it('should throw an Error when using assert in a test with error object message', function (done) { | ||
var fn = function () { | ||
Hoek.assert(false, new Error('This is spinal tap')); | ||
}; | ||
expect(fn).to.throw('This is spinal tap'); | ||
done(); | ||
}); | ||
}); | ||
@@ -748,0 +759,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
100575
1290