test: meaningful unit tests for server models/controllers + client logic #86
Reference in New Issue
Block a user
No description provided.
Delete Branch "test/coverage-meaningful-gaps"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What & why
Fill the meaningful test gaps across the repo — behavior a future change could silently break — rather than chasing a coverage number. Three scoped commits, one PR:
test(server): pages, shardState, moderation model logic— security-relevant model rules against an in-memory fake db.test(server): auth, invite, password-reset, public/shard controllers— controller decision logic + security boundaries (mock req/res, monkeypatched collaborators).test(client): pure-logic modules + CI/Sonar wiring— the client'slib/,api/,data/logic on Node's built-in runner, wired into the PR gate and Sonar coverage.The motivation is the same as the recent server-coverage CI work: make Runic Gateway the kind of project you can safely change months later. The 46% Sonar aggregate was mostly client/bot sitting at 0% (no runner); this establishes a client harness and closes the highest-value server gaps.
Highlights of what's now locked
PUBLIC_KINDSfeed allowlist, and the public house view stripping owner/price.is_idocderivation; region buckets always reconciling to the online total.How it was tested
All 423 tests green locally. No production code changed — tests + CI/Sonar config only.
Coverage lifts (line): server aggregate 63.5% → 70.4%; auth.controller 46→94%, passwordReset 33→93%, pages.model 23→82%, moderation.model 27→85%. New client tests: format/regionBuckets/heroLayout 100%, api client 86%, shardEvents 80%.
Checklist
AI-assisted contributions (required)
Claude Code (Opus 4.8). I have reviewed and understand every change, and take responsibility for it. AI-authored commits are marked with aCo-Authored-Bytrailer.License
🤖 Generated with Claude Code