8000 test: one harness for the command tests by dominikwozniak · Pull Request #99 · dominikwozniak/dw-mc · GitHub
[go: up one dir, main page]

Skip to content

test: one harness for the command tests - #99

Merged
dominikwozniak merged 1 commit into
mainfrom
test/88-command-harness
Sep 18, 2026
Merged

dominikwozniak merged 1 commit into
mainfrom
test/88-command-harness

Conversation

@dominikwozniak
Copy link
Copy Markdown
Owner

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/git dispatcher 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 the gh pr view field list as a string literal, so a field renamed in an adapter broke the CLI tests; they read it off gh.ts instead.

Closes #88.

What changes

  • src/adapters/spawner.ts — ships layerStubbed, the Stub type and json / wrote / refused / vectorOf. Stubs stack: the first that claims a vector answers, and one nothing claims dies.
  • src/adapters/picker.ts — ships recording beside layerScripted, because what a prompt draws in place and what a command prints a line at a time are one screen.
  • src/adapters/gh.ts — ships prViewOf beside prView, and names viewFields so a test spells the vector without copying the list.
  • src/cli/cli.ts — ships machineOf and run beside dwMc: the assembly src/cli/bin.ts makes, with a double at every seam.
  • ADR 0006 — records where the two things that are not a seam's double live: the shape a read answers with belongs to the adapter that makes the read, the machine those doubles assemble into belongs to cli.ts.

Test plan

  • pnpm check — pass
  • 695 tests, the same 695 as before. No assertion changed except the two that spelled the field list and now import it. A pure move has to leave the suite alone, and it did.
  • dist/bin.js diffed against a build of main: the only difference is the doc comment above viewFields. No fake reaches the bundle — which is why wrote("") replaced a shared wentWell constant, since a top-level Effect.succeed(...) survives tree-shaking as a statement that runs on every dw-mc.

@effect/vitest's layer() stays unused on purpose: it shares one layer across a describe, and Store.layerTest is 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 revert takes it back.

🤖 Generated with Claude Code

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>
@dominikwozniak
dominikwozniak merged commit 9317374 into main Sep 18, 2026
1 check passed
@dominikwozniak
dominikwozniak deleted the test/88-command-harness branch September 18, 2026 08:26
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.

test: one harness for the command tests

1 participant

0