Skip to content

Commit 3d5abff

Browse files
committed
test(code-index): assert happy-path task workspace routing (#1721)
1 parent 77191e4 commit 3d5abff

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎src/core/tools/__tests__/CodebaseSearchTool.spec.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ describe("CodebaseSearchTool", () => {
214214
return []
215215
})
216216
await tool.execute({ query, path }, task, callbacks)
217+
expect(CodeIndexManagerRegistry.getOrCreate).toHaveBeenCalledExactlyOnceWith(context, "/task")
217218
expect(manager.searchIndex).toHaveBeenCalledExactlyOnceWith(query, path)
218219
expect(callbacks.pushToolResult).toHaveBeenCalledExactlyOnceWith(
219220
`No relevant code snippets found for the query: "${query}"`,
@@ -253,6 +254,8 @@ describe("CodebaseSearchTool", () => {
253254
.mockReturnValueOnce("src/result.ts")
254255
.mockReturnValueOnce("lib/other.ts")
255256
await tool.execute({ query }, task, callbacks)
257+
expect(CodeIndexManagerRegistry.getOrCreate).toHaveBeenCalledExactlyOnceWith(context, "/task")
258+
expect(manager.searchIndex).toHaveBeenCalledExactlyOnceWith(query, undefined)
256259
expect(vscode.workspace.asRelativePath).toHaveBeenCalledTimes(2)
257260
expect(vscode.workspace.asRelativePath).toHaveBeenNthCalledWith(1, "/task/src/result.ts", false)
258261
expect(vscode.workspace.asRelativePath).toHaveBeenNthCalledWith(2, "/task/lib/other.ts", false)

0 commit comments

Comments
 (0)