Conversation
nhopeatall
left a comment
There was a problem hiding this comment.
Summary
LGTM — Clean, purely additive change that centralizes test payload construction into shared factories. All 7 CI checks pass, no existing code is modified, and the factories follow the established createMockProject() override pattern.
Should Fix (non-blocking)
-
Custom GitHub interfaces instead of source types: The PR defines
MockPR,CheckSuitePayload, andReviewPayloadas custom interfaces in the test helper rather than importing the existing source types (GitHubPullRequestPayload,GitHubCheckSuitePayload,GitHubPullRequestReviewPayloadfromsrc/triggers/github/types.ts). This creates a drift risk — if the source types evolve (e.g., new required fields), these factory interfaces won't break at compile time. SinceTriggerContext.payloadisunknown, the factories would still compile even if they produce structurally incompatible payloads. Consider importing and using the source types (orPartial<>of them) to keep the factories coupled to the real contract. The Trello factories already do this correctly withTrelloWebhookPayloadandTrelloCard. -
Misleading
@exampleoncreateTrelloActionPayload: The JSDoc example showscreateTrelloActionPayload({ action: { data: { listAfter: ... } } }), implying you can surgically overrideaction.data.listAfter. But with the shallow...overridesspread, this actually replaces the entireactionobject — losingid,idMemberCreator,type,date, and all otherdatafields. This could surprise consumers and lead to subtle test bugs. Consider either (a) noting the shallow-merge limitation in the docstring, or (b) using a deep-merge for these nested payloads.
🕵️ claude-code · claude-opus-4-6 · run details
Summary
createTrelloActionPayload(),createTrelloCard(),createTrelloTriggerContext()createMockPR(),createCheckSuitePayload(),createReviewPayload(),createGitHubTriggerContext()createMockProject()override pattern (sensible defaults + shallow-merge overrides param)Test plan
npm testpasses with all 332 test files and 6326 tests greenCard
https://trello.com/c/69c166bd870f89b4887a6ba8
🤖 Generated with Claude Code
🕵️ claude-code · claude-sonnet-4-6 · run details