Fix not.toThrow() matcher exception when used with no args.
This commit is contained in:
@@ -297,7 +297,7 @@ jasmine.Matchers.prototype.toThrow = function(expected) {
|
||||
|
||||
this.message = function() {
|
||||
if (exception && (expected === jasmine.undefined || !this.env.equals_(exception.message || exception, expected.message || expected))) {
|
||||
return ["Expected function to throw", expected.message || expected, ", but it threw", exception.message || exception].join(' ');
|
||||
return ["Expected function to throw", expected ? expected.message || expected : " an exception", ", but it threw", exception.message || exception].join(' ');
|
||||
} else {
|
||||
return "Expected function to throw an exception.";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user