Skip to content

Commit 526b808

Browse files
taltasclaude
andcommitted
fix(cli): correct type annotation for sendMessageMock in ask-dispatcher tests
TypeScript was failing to compile because the inferred type of `vi.fn()` didn't match the expected `(message: WebviewMessage) => void` signature. Fixed by adding an explicit type assertion and importing WebviewMessage type. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 7c3045f commit 526b808

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

apps/cli/src/agent/__tests__/ask-dispatcher.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { ClineMessage, ClineAsk } from "@roo-code/types"
1+
import type { ClineMessage, ClineAsk, WebviewMessage } from "@roo-code/types"
22
import { AskDispatcher } from "../ask-dispatcher.js"
33
import type { OutputManager } from "../output-manager.js"
44
import type { PromptManager } from "../prompt-manager.js"
@@ -19,12 +19,12 @@ const createMockPromptManager = (): PromptManager =>
1919
describe("AskDispatcher", () => {
2020
let mockOutputManager: OutputManager
2121
let mockPromptManager: PromptManager
22-
let sendMessageMock: ReturnType<typeof vi.fn>
22+
let sendMessageMock: (message: WebviewMessage) => void
2323

2424
beforeEach(() => {
2525
mockOutputManager = createMockOutputManager()
2626
mockPromptManager = createMockPromptManager()
27-
sendMessageMock = vi.fn()
27+
sendMessageMock = vi.fn() as (message: WebviewMessage) => void
2828
})
2929

3030
describe("handleAsk - disabled mode", () => {

0 commit comments

Comments
 (0)