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 ruleP1universalStack: universal
testingbrittle-testsassertions
Assert behavior and intent, not brittle exact config snapshots
Write tests that check the meaningful outcome (e.g. output contains key) instead of asserting an exact serialized config that breaks on any reorder.
PR: frontpage-web · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codejavascript
| 1 | expect(html.indexOf('window.AdLoaderAds = {"pageType":"nettguide","product":"..."')).toBe(0); |
Explanation (EN)
Objašnjenje (HR)
Good example
New codejavascript
| 1 | expect(html).toContain('window.AdLoaderAds'); |
Explanation (EN)
Objašnjenje (HR)