Repository navigation
test: cover untested public API in smoke.mjs (journey + knownThemes) - #21
Open
ashishbhateja wants to merge 1 commit into
Open
ashishbhateja wants to merge 1 commit into
ashishbhateja wants to merge 1 commit into
Conversation
Four exported symbols had no smoke-test coverage: - `monthsOfMovement` — not imported or exercised at all; new check verifies it returns the five "ground" months in calendar order with correct themes. - `movementOf(arc, number)` — only the object-argument path was tested; new check exercises the number path (the branch that calls `monthByNumber` internally) with August and September. - `mirrorOf` reverse lookup — both January and December carry an explicit `mirrors` field in the real arc, so the reverse-lookup branch (`arc.months.find(m => m.mirrors === number)`) was dead in every existing test. New check builds a minimal synthetic arc where only one side declares the link, forcing the reverse path. - `mirrorOf` null return — added an assertion that months with no mirror partner (May, July) return null. - `Personalizer.knownThemes()` — public method, zero coverage; new check verifies it unions declared interests with implicit affinity built from reading history. 19 → 24 checks, all green. Build unchanged.
This branch has not been deployed
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.
What this changes
Adds 5 new assertions to
scripts/smoke.mjs, bringing the check count from 19 to 24. Every new check exercises exported API that existed but had no coverage.journey.jsmonthsOfMovement— the function was not imported or called anywhere in the test suite. New check verifies it returns the five "ground" movement months in calendar order with correct themes.movementOf(arc, number)— the existing test only calledmovementOfwith a month object; the alternate branch that takes a raw number and callsmonthByNumberinternally was never reached. New check exercises it with August (presence) and September (forward).mirrorOfreverse lookup — both January and December carry an explicitmirrorsfield in the real arc, so the reverse-lookup branch (arc.months.find(m => m.mirrors === number)) was unreachable in every existing test. New check builds a minimal synthetic arc where only one side declares the link, forcing that branch.mirrorOfnull return — no assertion confirmed that months with no mirror partner (May, July) returnnull.personalize.jsPersonalizer.knownThemes()— public method exported and documented, zero coverage. New check confirms it returns the union of declared interests and implicit affinity built from reading history, and excludes unseen themes.Why
These are real code paths that ship in every build. A bug in any of them (e.g. a refactor that accidentally breaks
monthsOfMovement's sort, or themirrorOfreverse-lookup path) would go undetected. The coverage gap was the only reason to open this PR.Checklist
node scripts/smoke.mjspasses (24 checks)Generated by Claude Code