Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
abeatrix committed Jan 3, 2025
1 parent eb73c68 commit 10c0aa3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 1 addition & 4 deletions vscode/src/chat/agentic/CodyToolProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ export class ToolFactory {
if (!config) {
return undefined
}
if (this.toolInstances.has(name)) {
return this.toolInstances.get(name)
}
const instance = config.createInstance(config, ...args)
if (instance) {
this.toolInstances.set(name, instance)
Expand All @@ -51,7 +48,7 @@ export class ToolFactory {
}

public getAllToolInstances(): CodyTool[] {
if (!toolboxSettings.getSettings().shell ?? false) {
if (!toolboxSettings.getSettings().shell) {
this.toolInstances.delete('CliTool')
}
return Array.from(this.toolInstances.values())
Expand Down
4 changes: 2 additions & 2 deletions vscode/src/chat/chat-view/ChatController.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ describe('ChatController', () => {
await vi.runOnlyPendingTimersAsync()
expect(mockChatClient.chat).toBeCalledTimes(1)
expect(addBotMessageSpy).toHaveBeenCalledWith('1', ps`Test reply 1`, 'my-model')
expect(postMessageSpy.mock.calls.at(5)?.at(0)).toStrictEqual<
expect(postMessageSpy.mock.calls.at(6)?.at(0)).toStrictEqual<
Extract<ExtensionMessage, { type: 'transcript' }>
>({
type: 'transcript',
Expand Down Expand Up @@ -382,7 +382,7 @@ describe('ChatController', () => {
await vi.runOnlyPendingTimersAsync()
expect(mockChatClient.chat).toBeCalledTimes(1)
expect(addBotMessageSpy).toHaveBeenCalledWith('1', ps`Test partial reply`, 'my-model')
expect(postMessageSpy.mock.calls.at(8)?.at(0)).toStrictEqual<
expect(postMessageSpy.mock.calls.at(9)?.at(0)).toStrictEqual<
Extract<ExtensionMessage, { type: 'transcript' }>
>({
type: 'transcript',
Expand Down

0 comments on commit 10c0aa3

Please sign in to comment.