test(game): coverage gate for decomposed Game modules (Phase 8 of #134) - #143
Merged
nodots merged 1 commit intoJul 15, 2026
Conversation
Add targeted tests for the decomposed modules and a COVERAGE=1-gated threshold scoped to src/Game/: - guards.ts -> 100% (canRoll/canRollForStart/canPlayerRoll/canGetPossibleMoves) - robot.ts -> 88% (handleRobotMovedState, confirmTurnWithRobotAutomation) - game-accessors: activePlayer/inactivePlayer/getPlayersForColor/findChecker + createNewGame rules merge - turnFlow: roll (rolled-for-start/rolling/doubled), switchDice, executeAndRecalculate, checkAndCompleteTurn, toMoved, moveAndFinalize - cube: acceptDouble-at-64 (maxxed) and refuseDouble non-first-double Game/ aggregate coverage: ~59% -> 80.5% stmts, 71.8% branch, 89% funcs, 82.5% lines. Gate uses a directory-path key (aggregate, not per-file) at 75/70/75/75; branch floor ratchets toward 75 as turnFlow no-move/blocked paths and the gnuPositionId getter gain coverage. Enforced only under COVERAGE=1, so normal jest runs are unaffected. Core: 518 passed / 12 skipped; COVERAGE=1 exit 0; normal exit 0. Refs #134
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.
Phase 8 of the epic (#133) — coverage gate (#134)
Stacked on #142 (Phase 7). Retarget to
developmentas parents merge.Adds targeted tests for the decomposed
Game/modules plus aCOVERAGE=1-gated threshold scoped tosrc/Game/.Coverage added
guards.tsrobot.tscube.tsindex.tsturnFlow.tssrc/Game/aggregate: ~59% → 80.5% stmts, 71.8% branch, 89% funcs, 82.5% lines.The gate
src/Game/(not per-file), so well-covered modules balance the thinexecuteRobotTurndelegator and the largeturnFlow.COVERAGE=1(the CI coverage job); normaljestruns are unaffected.turnFlowno-move/blocked paths and thegnuPositionIdgetter gain coverage — per the "ratchet up, don't jump" plan.Verification
COVERAGE=1 npx jest: exit 0, gate satisfiednpx jest: 518 passed / 12 skipped, exit 0Follow-up
Branch → 75 needs blocked-board fixtures for
roll's no-move transitions and anew Game()fixture for thegnuPositionIdgetter; deferred so the gate can land now.Refs #134