refactor(tests): share the router-open fixtures between its suites - #2585
Merged
Merged
Conversation
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>
Size Report
Startup median (7 runs, lower is better):
|
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. |
|
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.
Summary
Follow-up cleanup from #2570. Splitting the routed claim tests out of
request-router-open.test.tscopied three fixtures into the new suite: the simulator fixture, theopenrequest builder, and the reader that lifts a claim's stamp off disk.storedClaimUpdatedAthad 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.tsowns those fixtures. Each suite keeps its owncreateOpenHandler, 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 --runpassed every runnable check, including layering, fallow, and related vitest (18 tests across both suites), pluspnpm check:layering,pnpm lint, andtsc --noEmitdirectly. Behavior is unchanged: the same 18 tests pass before and after, and thetest-file-size-ratchetgate stays green withrequest-router-open.test.tsat 834 lines.