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: node
testingartifactsisolationcache
Write test-generated artifacts to a dedicated, gitignored location
Direct files produced during tests (caches, temp output) to a separate test-only path that is gitignored, so they never collide with or pollute application artifacts.
PR: frontpage-web · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codetypescript
| 1 | // test writes to the same path the app uses |
| 2 | const cacheFile = `${__dirname}/../../../currencies`; |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | // app -> build/cache/, tests -> test/cache/ (gitignored) |
| 2 | const cacheFile = `${testCacheDir}/currencies`; |
Explanation (EN)
Objašnjenje (HR)