Skip to content

Commit 06eb31d

Browse files
fix(test): cast ask.mock.calls in readFileTool spec to fix tsc overload
1 parent ea9d3df commit 06eb31d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/core/tools/__tests__/readFileTool.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ describe("ReadFileTool", () => {
225225
)
226226

227227
// The approval payload must reflect the boundary decision.
228-
const toolAsk = mockTask.ask.mock.calls.find(([type]: [string]) => type === "tool")
228+
const toolAsk = (mockTask.ask.mock.calls as any[]).find(([type]: [string]) => type === "tool")
229229
expect(toolAsk).toBeDefined()
230230
expect(JSON.parse(toolAsk![1] as string)).toEqual(
231231
expect.objectContaining({ tool: "readFile", isOutsideWorkspace: false }),
@@ -253,7 +253,7 @@ describe("ReadFileTool", () => {
253253

254254
await readFileTool.execute({ path: "link-to-outside.txt" }, mockTask as any, callbacks)
255255

256-
const toolAsk = mockTask.ask.mock.calls.find(([type]: [string]) => type === "tool")
256+
const toolAsk = (mockTask.ask.mock.calls as any[]).find(([type]: [string]) => type === "tool")
257257
expect(toolAsk).toBeDefined()
258258
expect(JSON.parse(toolAsk![1] as string)).toEqual(
259259
expect.objectContaining({ tool: "readFile", isOutsideWorkspace: true }),

0 commit comments

Comments
 (0)