Repository navigation
Conversation
Pin what the pure code returns today, byte for byte, as a regression net before refactoring: test/golden.ts (expectGolden; UPDATE_GOLDENS=1 writes) and 98 golden files in test/goldens/ from 32 golden tests: - journey: parsing (fixtures and crafted rule breaks), anchors, code links, value hints, marks, step card text, steps placed after edits, search, the Journeys list model, the map layout's pure parts - podcast: the full check of every case, the sample episode, timing, marks - notes: note files read and written back, refusals, the merge, v2 and compact anchors after edits - check: the understanding check end to end on the refunds fixture (the skill's script, CLI output and JSON, the Check view at each stage, threads, grading, CI), broken check files, prompts and failures npm run test:goldens runs them alone; npm test includes them. test/README.md says what is pinned, how to update and review.
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.
A byte-for-byte regression net for the pure logic, to land before a big refactor: a refactor should leave
test/goldens/untouched.What is pinned
98 golden files from 32 golden tests (
test/golden-*.test.ts,test/cli/golden-understanding.test.mjs):parseJourneyreads it, old-format files it refuses, 23 crafted rule breaks (the refusal or the problems), anchors / code links / value hints / marks as read, marks found in code and their problems, code-link markup, paths in step text, each step card's text (as written, moved, stale, renamed and gone files), the shop journey's steps placed in its code after edits, search words and scores, the Journeys list model (sorts, searches, chips, the active file), the map layout's pure parts (media/journey-layout.js).cases.json(problems, messages, paths, places in the file, the episode), the sample episode the panel is sent, its timing (views, chapters, jumps, calm views, resume), marks.test/fixtures/grader-cases(the skill's script output and the check file, every CLI command's output andstatus --json, the Check view at each stage, each question's thread, grading replies and refused ones, the CI job and its MR comment), broken check files and whatvalidatesays, drift / conflicts / the default branch, the prompts, failures in plain words, TODO comments, the view's names and requests.Not pinned (built inside vscode-dependent classes): the panel's
tour/journeymessage (mapState), the step card, the podcast player's messages,layout()(measures the DOM); their pure payloads are pinned. The quiz is not onmain, so it has no goldens.How
test/golden.ts:expectGolden(area, name, value)writes a string as is (.txt), anything else asJSON.stringify(v, null, 2)in its real key order, withundefined, Maps, Sets and NaN spelled out. Missing or different fails with a diff. The CLI goldens replace temporary paths, ISO times and commit ids with stable names; the journey goldens run in UTC..gitattributeskeepstest/goldens/out of line-ending conversion.npm run test:goldens: the goldens alone (about 3 s of tests aftertsc).npm testincludes them (they areout/test/*.test.jsandtest/cli/*.test.mjs, counted once): 365 → 397 tests.UPDATE_GOLDENS=1 npm run test:goldens, then reviewgit diff test/goldens. Details intest/README.md.Deterministic: three runs in a row, and under
TZ=Pacific/Auckland LANG=C LC_ALL=CandTZ=America/Los_Angeles LANG=de_DE.UTF-8, all green with no file changed. No production code changed.Negative controls
Three breaks planted in a scratch copy (not committed), each run with
npm run test:goldens:has no file→has no file name(src/journeyModel.ts)journey/parse.invalid.jsonpassed >= need→passed > need(cli/understanding/state.mjs)check/states.jsonmr→mrUrlincheckViewonly (type unchanged, sotscpasses; the page still readsmr)check/refunds.stage.committed.json