Fix: Fix syntax error in beforeAll hook execution

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 <Electroid@users.noreply.github.com>

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
claude[bot]
2025-05-19 19:35:31 +00:00
committed by GitHub
parent 2f2d89c619
commit efa77bc9fd

View File

@@ -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);