Improve assert.throws output

This commit is contained in:
Richard Gibson 2020-08-20 16:55:55 -04:00 committed by Rick Waldron
parent 93ff9b7262
commit 6207a8058a

View File

@ -84,7 +84,7 @@ assert.throws = function (expectedErrorConstructor, func, message) {
message += 'Thrown value was not an object!'; message += 'Thrown value was not an object!';
$ERROR(message); $ERROR(message);
} else if (thrown.constructor !== expectedErrorConstructor) { } else if (thrown.constructor !== expectedErrorConstructor) {
message += 'Expected a ' + expectedErrorConstructor.name + ' but got a ' + thrown.constructor.name; message += 'Expected a ' + expectedErrorConstructor.name + ' but got a ' + thrown.constructor.name + ' ' + thrown.message;
$ERROR(message); $ERROR(message);
} }
return; return;