diff options
Diffstat (limited to 'src/bun.js/test/jest.zig')
-rw-r--r-- | src/bun.js/test/jest.zig | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/bun.js/test/jest.zig b/src/bun.js/test/jest.zig index 283f369ff..5490b3472 100644 --- a/src/bun.js/test/jest.zig +++ b/src/bun.js/test/jest.zig @@ -808,9 +808,17 @@ pub const DescribeScope = struct { return false; } + fn isWithinTodoScope(this: *const DescribeScope) bool { + if (this.tag == .todo) return true; + if (this.parent != null) return this.parent.?.isWithinTodoScope(); + return false; + } + pub fn shouldEvaluateScope(this: *const DescribeScope) bool { - if (this.isWithinSkipScope()) return false; - if (Jest.runner.?.only and this.isWithinOnlyScope()) return true; + if (this.tag == .skip or + this.tag == .todo) return false; + if (Jest.runner.?.only and this.tag == .only) return true; + if (this.parent != null) return this.parent.?.shouldEvaluateScope(); return true; } |