mirror of
https://github.com/tc39/test262.git
synced 2025-07-25 23:14:47 +02:00
Improve assert.throws output
This commit is contained in:
parent
93ff9b7262
commit
6207a8058a
@ -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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user