Skip to content

Commit

Permalink
fix: optimize collection beforeEach hooks (#15198)
Browse files Browse the repository at this point in the history
  • Loading branch information
Connormiha authored Jul 21, 2024
1 parent 41f842a commit 8e9950e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/jest-circus/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export const getEachHooksForTest = (test: Circus.TestEntry): TestHooks => {
}
// 'beforeEach' hooks are executed from top to bottom, the opposite of the
// way we traversed it.
result.beforeEach = [...beforeEachForCurrentBlock, ...result.beforeEach];
result.beforeEach.unshift(...beforeEachForCurrentBlock);
} while ((block = block.parent));
return result;
};
Expand Down

0 comments on commit 8e9950e

Please sign in to comment.