Skip to content

Commit e1ff13a

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

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
@@ -238,6 +238,7 @@ describe("CodebaseSearchTool", () => {
238238
return []
239239
})
240240
await tool.execute({ query, path }, task, callbacks)
241+
expect(CodeIndexManagerRegistry.getOrCreate).toHaveBeenCalledExactlyOnceWith(context, "/task")
241242
expect(manager.searchIndex).toHaveBeenCalledExactlyOnceWith(query, path)
242243
expect(callbacks.pushToolResult).toHaveBeenCalledExactlyOnceWith(
243244
`No relevant code snippets found for the query: "${query}"`,
@@ -277,6 +278,8 @@ describe("CodebaseSearchTool", () => {
277278
.mockReturnValueOnce("src/result.ts")
278279
.mockReturnValueOnce("lib/other.ts")
279280
await tool.execute({ query }, task, callbacks)
281+
expect(CodeIndexManagerRegistry.getOrCreate).toHaveBeenCalledExactlyOnceWith(context, "/task")
282+
expect(manager.searchIndex).toHaveBeenCalledExactlyOnceWith(query, undefined)
280283
expect(vscode.workspace.asRelativePath).toHaveBeenCalledTimes(2)
281284
expect(vscode.workspace.asRelativePath).toHaveBeenNthCalledWith(1, "/task/src/result.ts", false)
282285
expect(vscode.workspace.asRelativePath).toHaveBeenNthCalledWith(2, "/task/lib/other.ts", false)

0 commit comments

Comments
 (0)