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).
frontend ruleP1universalStack: Testing
testingmocksassetsreliability
Mock remote assets with local files, never hit real URLs in tests
Don't passthrough to real remote assets in tests — it incurs cost and flakiness; serve small local test images instead.
PR: hegnar-bellsheep-web · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codets
| 1 | http.get('https://cdn.example.com/avatar.jpg', () => passthrough()); // hits real storage, costs egress |
Explanation (EN)
Objašnjenje (HR)
Good example
New codets
| 1 | http.get('https://cdn.example.com/avatar.jpg', () => HttpResponse.arrayBuffer(localTestImage)); |
Explanation (EN)
Objašnjenje (HR)