Rules Hub
Coding Rules Library
← Back to all rules
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
fullstack ruleP2universalStack: universal
testingmockscleanupconfiguration
Don't repeat mock resets already configured globally
If the test runner is set up with clearMocks/restoreMocks globally, per-test resetAllMocks/clearAllMocks calls are redundant.
PR: hegnar-web · org-mining-deep-2026-06Created: Jun 17, 2026
Bad example
Old codetypescript
| 1 | beforeEach(() => { vi.clearAllMocks(); }); // already global |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | // rely on global clearMocks: true / restoreMocks: true |
Explanation (EN)
Objašnjenje (HR)