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: javascript
testingassertionsdiagnostics
Include identifying context in test assertion messages
Assertion failures should name the file/case under test so the message is actionable without spelunking.
PR: frontpage-web · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codejavascript
| 1 | assert(size < 1100); // 'should be less than 1100 but is 12170' - which file? |
Explanation (EN)
Objašnjenje (HR)
Good example
New codejavascript
| 1 | assert(size < 1100, `${filename}: bundle size should be < 1100 but is ${size}`); |
Explanation (EN)
Objašnjenje (HR)