diff options
-rw-r--r-- | src/bun.js/test/jest.zig | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/bun.js/test/jest.zig b/src/bun.js/test/jest.zig index 3dcecab4c..2c26600c4 100644 --- a/src/bun.js/test/jest.zig +++ b/src/bun.js/test/jest.zig @@ -1478,11 +1478,17 @@ pub const Expect = struct { const thisValue = callFrame.this(); const value: JSValue = Expect.capturedValueGetCached(thisValue) orelse { - globalObject.throw("internal consistency error: the expect(value) was garbage collected but it should not have been!", .{}); + globalObject.throw("Internal consistency error: the expect(value) was garbage collected but it should not have been!", .{}); return .zero; }; value.ensureStillAlive(); + if (this.scope.tests.items.len <= this.test_id) { + globalObject.throw("toBeFalsy() must be called in a test", .{}); + return .zero; + } + active_test_expectation_counter.actual += 1; + const not = this.op.contains(.not); var pass = false; |