Tests: Vitest domain-logic suite + CI gate (+ findTank bug fix) - #19
Merged
Conversation
Tier-1 tests over the pure domain logic — the rules that cost real film when
wrong: HC-110 dilution letters (H=1+63, not 1+119), min-syrup floors, Dev Id
formatting, dev-shorthand parsing. 43 tests, 100% function/line coverage on
those modules (94% stmts / 90% branches).
The suite immediately caught a bug: findTank("paterson") resolved to the MOD54
because its name is "MOD54 (Paterson Universal)" and the matcher's greedy
name-substring check won over the real Paterson tanks. Fixed the resolution
order: exact key -> intent shorthands -> fuzzy name.
- Vitest + @vitest/coverage-v8; `npm test` / `npm run test:coverage`.
- CI: new ci.yml runs build+tests+coverage on every PR/branch; the deploy
workflow's gate now runs tests too (a red suite blocks prod).
- README: a short Testing section.
Integration coverage of API/MCP mutation paths tracked in #15.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
First test suite — Tier 1: the pure domain logic (dilution math, Dev Ids, dev-shorthand), the rules that cost real film when wrong.
H=1+63and min-syrup assertions are guardrails against the exact mistakes that have bitten before.findTank("paterson")resolved to the MOD54 (its name is "MOD54 (Paterson Universal)"). Fixed the match order: exact key → intent shorthands → fuzzy name.ci.ymlruns build + tests + coverage on every PR; the deploy gate now runs tests too (red suite blocks prod).Integration coverage of the API/MCP mutation paths is tracked in #15 (Tier 2).
🤖 Generated with Claude Code