Skip to content

refactor(tests): share the router-open fixtures between its suites - #2585

Merged
thymikee merged 1 commit into
mainfrom
t3code/cleanup-claim-tests
Sep 14, 2026
Merged

thymikee merged 1 commit into
mainfrom
t3code/cleanup-claim-tests

Conversation

@thymikee

Copy link
Copy Markdown
Member

Summary

Follow-up cleanup from #2570. Splitting the routed claim tests out of request-router-open.test.ts copied three fixtures into the new suite: the simulator fixture, the open request builder, and the reader that lifts a claim's stamp off disk. storedClaimUpdatedAt had already become the place two suites re-read the same production state, and a change to the claim record now has two call sites to find.

src/daemon/__tests__/request-router-open-harness.ts owns those fixtures. Each suite keeps its own createOpenHandler, because that composition is where each one installs its mocks; sharing it changed which module instances the router saw and broke four routing assertions in this branch's first commit.

141 gross lines, three files, no production change.

Validation

Tested at d8374a819f. pnpm check:affected --run passed every runnable check, including layering, fallow, and related vitest (18 tests across both suites), plus pnpm check:layering, pnpm lint, and tsc --noEmit directly. Behavior is unchanged: the same 18 tests pass before and after, and the test-file-size-ratchet gate stays green with request-router-open.test.ts at 834 lines.

Splitting the routed claim tests off `request-router-open.test.ts` copied the device fixture, the
open request builder, and the reader that lifts a claim stamp off disk into the new file. Both
suites keep their own handler composition, which is where each installs its mocks.

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Size Report

Metric Base Current Diff
Installed (including dependencies) 4.53 MB 4.53 MB 0 B
Package (unpacked) 4.53 MB 4.53 MB 0 B
Package (download) 1.34 MB 1.34 MB +12 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 28.3 ms 28.0 ms -0.3 ms
CLI --help 83.5 ms 80.0 ms -3.5 ms

@thymikee

Copy link
Copy Markdown
Member Author

Clean at d8374a8. The shared fixtures preserve both suites’ mock composition and test discovery; the same 18 tests remain covered. All checks pass, with no merge conflicts.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Sep 14, 2026
@thymikee
thymikee merged commit 7f55c56 into main Sep 14, 2026
17 checks passed
@thymikee
thymikee deleted the t3code/cleanup-claim-tests branch September 14, 2026 12:41
@github-actions

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-09-14 12:42 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant