mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 10:28:47 +00:00
toBeFalsy expect counter and test scope check (#2661)
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user