test: move simulateTraffic to scripts/ and add missing test cases#49
Merged
jorge07 merged 1 commit intojorge07:masterfrom Feb 22, 2026
Merged
Conversation
D2.3 + D2.4 from Phase 2 roadmap.
D2.3 — Move simulateTraffic.ts out of tests/
Violation: tests/ directory should contain automated tests only.
simulateTraffic.ts is a manual load test utility that hits a live
server and has no describe/test blocks. Jest may attempt to discover
it, and it misleads contributors about what constitutes a test.
Fix: move to scripts/simulate-traffic.ts with a doc comment
explaining its purpose and usage.
D2.4 — Add missing test coverage
Transaction.test.ts:
- Creating with negative price is rejected by the domain
- Creating with unknown currency is rejected by the domain
GetOne.test.ts:
- GetOne a non-existent transaction throws NotFoundException
- Add prom.register.clear() to beforeEach (missing, caused duplicate
metric error when test suites run in the same process)
Tests: 17 suites pass (was 14 before this branch).
jorge07
approved these changes
Feb 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
D2.3 — Move simulateTraffic out of tests/
Violation:
tests/should contain automated tests only.simulateTraffic.tsis a manual load test utility that hits a live server and has nodescribe/testblocks. Jest may attempt to discover it, and it misleads contributors.Fix: Moved to
scripts/simulate-traffic.tswith a doc comment explaining purpose and usage (npx ts-node scripts/simulate-traffic.ts).D2.4 — Missing test cases
Transaction.test.tsThese tests verify that the domain's invariants hold at the aggregate factory boundary — not just at the VO level.
GetOne.test.tsGetOnefor a non-existent transaction throwsNotFoundExceptionprom.register.clear()tobeforeEach(was missing — caused a duplicate metric registration error when test suites run sequentially in the same process)Tests
17/17 pass.