mirror of
https://github.com/oven-sh/bun
synced 2026-02-19 07:12:24 +00:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user