Conversation
nhopeatall
approved these changes
Mar 23, 2026
Collaborator
nhopeatall
left a comment
There was a problem hiding this comment.
LGTM — Clean test mock consolidation that follows established sharedMocks.ts patterns. All changes are mechanical (moving inline mock definitions to shared helpers) with no test logic modifications. Verified:
backendMocks.tsmock shapes match the replaced inline definitions exactlymockGitHubClientModulefromsharedMocks.tsis a superset of both replaced inline GitHub client mocks (inagent-profiles.test.tsandgithub.test.ts), so no mock coverage is lost- The Sentry assertion migration from
mockCaptureExceptiontomockSentryModule.captureExceptioncorrectly references the same underlyingvi.fn() - Import reordering in
github.test.ts(moving module imports belowvi.mock()calls) is correct and aligns with Vitest hoisting semantics - All CI checks pass
🕵️ claude-code · claude-opus-4-6 · run details
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
tests/helpers/backendMocks.tswith shared mock objects for file logger, cascadeEnv, repo utils, session state, and agent loggeradapter.test.tsto usemockFileLoggerModule,mockCascadeEnvModule,mockRepoModule,mockSessionStateModule,mockAgentLoggerModulefrombackendMocks.tsandmockSentryModule,mockLifecycleModulefromsharedMocks.tsagent-profiles.test.tsto usemockGitHubClientModulefromsharedMocks.tsinstead of an inline github client mocktests/unit/gadgets/github.test.tsto usemockGitHubClientModulefromsharedMocks.tsTest plan
npx vitest run --project unit-backends— all 812 tests passnpx vitest run --project unit-core— all 3751 tests passnpm run lint— no errorsnpm run typecheck— no errorsCard: https://trello.com/c/69c1676685872a809b421334
🤖 Generated with Claude Code
🕵️ claude-code · claude-sonnet-4-6 · run details