aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/bun.js')
-rw-r--r--src/bun.js/test/jest.zig8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/bun.js/test/jest.zig b/src/bun.js/test/jest.zig
index c1e38f0ac..00c8148b2 100644
--- a/src/bun.js/test/jest.zig
+++ b/src/bun.js/test/jest.zig
@@ -1130,10 +1130,12 @@ pub const Expect = struct {
if (matched_expectation) return thisValue;
if (expected_value.isEmptyOrUndefinedOrNull()) {
- if (did_throw)
+ if (!not)
globalObject.throw("Expected function to throw", .{})
- else
- globalObject.throw("Expected function not to throw", .{});
+ else {
+ var fmt = JSC.ZigConsoleClient.Formatter{ .globalThis = globalObject };
+ globalObject.throw("Expected function not to throw. Received:\n\t{any}", .{result_.?.toFmt(globalObject, &fmt)});
+ }
return .zero;
}