summaryrefslogtreecommitdiff
path: root/std/testing/asserts.ts
diff options
context:
space:
mode:
Diffstat (limited to 'std/testing/asserts.ts')
-rw-r--r--std/testing/asserts.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/std/testing/asserts.ts b/std/testing/asserts.ts
index d562447c8..1c6dfff19 100644
--- a/std/testing/asserts.ts
+++ b/std/testing/asserts.ts
@@ -315,9 +315,9 @@ export function assertThrows(
fn();
} catch (e) {
if (ErrorClass && !(Object.getPrototypeOf(e) === ErrorClass.prototype)) {
- msg = `Expected error to be instance of "${ErrorClass.name}"${
- msg ? `: ${msg}` : "."
- }`;
+ msg = `Expected error to be instance of "${ErrorClass.name}", but was "${
+ e.constructor.name
+ }"${msg ? `: ${msg}` : "."}`;
throw new AssertionError(msg);
}
if (msgIncludes && !e.message.includes(msgIncludes)) {