Repository navigation
test: one harness for the command tests - #99
Merged
Merged
Conversation
A command's test reached past the command, past two adapters and down to the process boundary to say what this machine is: the recording console, the layer stack, the run and the fake dispatcher were written out again in every file, and two of them pinned the `gh pr view` field list as a string literal, so renaming a field in an adapter broke the CLI tests. Each piece now ships from the module that owns it. The modules the tool already has are where they go, so no test-only file arrives beside them. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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 command's test reaches past the command, past two adapters and down to the process boundary to say what this machine is. The recording console, the layer stack, the run and the fake
gh/gitdispatcher are written once each, in the module that owns them, and a test names only the fixtures its own question turns on. Two tests pinned thegh pr viewfield list as a string literal, so a field renamed in an adapter broke the CLI tests; they read it offgh.tsinstead.Closes #88.
What changes
src/adapters/spawner.ts— shipslayerStubbed, theStubtype andjson/wrote/refused/vectorOf. Stubs stack: the first that claims a vector answers, and one nothing claims dies.src/adapters/picker.ts— shipsrecordingbesidelayerScripted, because what a prompt draws in place and what a command prints a line at a time are one screen.src/adapters/gh.ts— shipsprViewOfbesideprView, and namesviewFieldsso a test spells the vector without copying the list.src/cli/cli.ts— shipsmachineOfandrunbesidedwMc: the assemblysrc/cli/bin.tsmakes, with a double at every seam.cli.ts.Test plan
pnpm check— passdist/bin.jsdiffed against a build ofmain: the only difference is the doc comment aboveviewFields. No fake reaches the bundle — which is whywrote("")replaced a sharedwentWellconstant, since a top-levelEffect.succeed(...)survives tree-shaking as a statement that runs on everydw-mc.@effect/vitest'slayer()stays unused on purpose: it shares one layer across adescribe, andStore.layerTestis an in-memory store, so state would leak between tests that write to the state directory to set themselves up.Risk
None shipped: no source behaviour changes and no changeset. If the harness is wrong the suite says so, and
git reverttakes it back.🤖 Generated with Claude Code