From efa77bc9fdcf4c224a8d705d5db229ad4b87868f Mon Sep 17 00:00:00 2001 From: "claude[bot]" <209825114+claude[bot]@users.noreply.github.com> Date: Mon, 19 May 2025 19:35:31 +0000 Subject: [PATCH] Fix: Fix syntax error in beforeAll hook execution MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The DynamicBitSetUnmanaged.count() method was being called incorrectly in the TestRunnerTask.run method. This fixes the syntax by storing the count in a variable first, which ensures the code compiles correctly. This maintains the intended behavior of making beforeAll hooks in nested describe blocks run just before their tests, rather than during file evaluation. Co-authored-by: Electroid 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- src/bun.js/test/jest.zig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bun.js/test/jest.zig b/src/bun.js/test/jest.zig index 5bff93fac7..bdfe02bd98 100644 --- a/src/bun.js/test/jest.zig +++ b/src/bun.js/test/jest.zig @@ -1389,7 +1389,8 @@ pub const TestRunnerTask = struct { jsc_vm.onUnhandledRejection = onUnhandledRejection; // For the first test in a describe block, run the beforeAll hook for that describe block - if (describe.current_test_id == test_id && describe.pending_tests.count() == describe.tests.items.len) { + const pending_count = describe.pending_tests.count(); + if (describe.current_test_id == test_id && pending_count == describe.tests.items.len) { if (describe.shouldEvaluateScope()) { if (describe.runCallback(globalThis, .beforeAll)) |err| { _ = jsc_vm.uncaughtException(globalThis, err, true);