Skip to content

Tests: Vitest domain-logic suite + CI gate (+ findTank bug fix) - #19

Merged
fhwrdh merged 1 commit into
mainfrom
feat/tests-tier1
Aug 17, 2026
Merged

Tests: Vitest domain-logic suite + CI gate (+ findTank bug fix)#19
fhwrdh merged 1 commit into
mainfrom
feat/tests-tier1

Conversation

@fhwrdh

@fhwrdh fhwrdh commented Aug 17, 2026

Copy link
Copy Markdown
Owner

First test suite — Tier 1: the pure domain logic (dilution math, Dev Ids, dev-shorthand), the rules that cost real film when wrong.

  • 43 tests, 100% function/line coverage on those modules (94% stmts / 90% branches).
  • The HC-110 H=1+63 and min-syrup assertions are guardrails against the exact mistakes that have bitten before.
  • The suite caught a bug on day one: findTank("paterson") resolved to the MOD54 (its name is "MOD54 (Paterson Universal)"). Fixed the match order: exact key → intent shorthands → fuzzy name.
  • CI: new ci.yml runs 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

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>
@fhwrdh
fhwrdh merged commit 751695e into main Aug 17, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant