Skip to content

test(journey): cover three untested public exports - #26

Open
ashishbhateja wants to merge 1 commit into
mainfrom
test/journey-coverage
Open

ashishbhateja wants to merge 1 commit into
mainfrom
test/journey-coverage

Conversation

@ashishbhateja

Copy link
Copy Markdown
Owner

What

Three exported functions from src/journey.js had no direct assertions in scripts/smoke.mjs, meaning their contracts could regress silently:

Function Gap
monthsOfMovement(arc, movementId) Completely untested directly (only exercised indirectly via asMovements)
movementOf(arc, number) Number-argument overload untested — only the object form was asserted
mirrorOf(arc, n) Null return case (month with no mirror partner, or out-of-range number) was not covered

This PR adds one focused assertion per gap: 22 checks, up from 19.

Why it matters

monthsOfMovement, movementOf, and mirrorOf are part of the public API and are imported by reader.js to drive the journey UI. Any refactor of journey.js now has a failing test as a safety net for these three behaviours.

Verification

npm test   # 22 checks passed

Generated by Claude Code

monthsOfMovement, the number-argument overload of movementOf, and the
null return of mirrorOf (for a month with no mirror partner or an
out-of-range number) were all exported from journey.js but had no
direct assertions in smoke.mjs.  Three new checks close those gaps and
lock the contracts so future refactors can't regress them silently.

This branch has not been deployed

No deployments
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.

2 participants