@@ -15,7 +15,6 @@ import { ToolUse } from '@amzn/codewhisperer-streaming'
1515import path from 'path'
1616import fs from '../../../shared/fs/fs'
1717import { ListDirectory } from '../../../codewhispererChat/tools/listDirectory'
18- import { ChatStream } from '../../../codewhispererChat/tools/chatStream'
1918
2019describe ( 'ToolUtils' , function ( ) {
2120 let sandbox : sinon . SinonSandbox
@@ -24,7 +23,6 @@ describe('ToolUtils', function () {
2423 let mockExecuteBash : sinon . SinonStubbedInstance < ExecuteBash >
2524 let mockListDirectory : sinon . SinonStubbedInstance < ListDirectory >
2625 let mockWritable : sinon . SinonStubbedInstance < Writable >
27- let mockChatStream : sinon . SinonStubbedInstance < ChatStream >
2826
2927 beforeEach ( function ( ) {
3028 sandbox = sinon . createSandbox ( )
@@ -35,7 +33,6 @@ describe('ToolUtils', function () {
3533 mockWritable = {
3634 write : sandbox . stub ( ) ,
3735 } as unknown as sinon . SinonStubbedInstance < Writable >
38- mockChatStream = sandbox . createStubInstance ( ChatStream )
3936 ; ( mockFsRead . requiresAcceptance as sinon . SinonStub ) . returns ( { requiresAcceptance : false } )
4037 ; ( mockListDirectory . requiresAcceptance as sinon . SinonStub ) . returns ( { requiresAcceptance : false } )
4138 } )
@@ -188,30 +185,30 @@ describe('ToolUtils', function () {
188185 // TODO: Adding "void" to the following tests for the current implementation but in the next followup PR I will fix this issue.
189186 it ( 'delegates to FsRead tool queueDescription method' , function ( ) {
190187 const tool : Tool = { type : ToolType . FsRead , tool : mockFsRead as unknown as FsRead }
191- void ToolUtils . queueDescription ( tool , mockWritable as unknown as ChatStream )
188+ void ToolUtils . queueDescription ( tool , mockWritable as unknown as Writable , false )
192189
193- assert ( mockFsRead . queueDescription . calledOnceWith ( mockChatStream ) )
190+ assert ( mockFsRead . queueDescription . calledOnceWith ( mockWritable , false ) )
194191 } )
195192
196193 it ( 'delegates to FsWrite tool queueDescription method' , function ( ) {
197194 const tool : Tool = { type : ToolType . FsWrite , tool : mockFsWrite as unknown as FsWrite }
198- void ToolUtils . queueDescription ( tool , mockWritable as unknown as ChatStream )
195+ void ToolUtils . queueDescription ( tool , mockWritable as unknown as Writable , false )
199196
200197 assert ( mockFsWrite . queueDescription . calledOnceWith ( mockWritable ) )
201198 } )
202199
203200 it ( 'delegates to ExecuteBash tool queueDescription method' , function ( ) {
204201 const tool : Tool = { type : ToolType . ExecuteBash , tool : mockExecuteBash as unknown as ExecuteBash }
205- void ToolUtils . queueDescription ( tool , mockWritable as unknown as ChatStream )
202+ void ToolUtils . queueDescription ( tool , mockWritable as unknown as Writable , false )
206203
207204 assert ( mockExecuteBash . queueDescription . calledOnceWith ( mockWritable ) )
208205 } )
209206
210207 it ( 'delegates to ListDirectory tool queueDescription method' , function ( ) {
211208 const tool : Tool = { type : ToolType . ListDirectory , tool : mockListDirectory as unknown as ListDirectory }
212- void ToolUtils . queueDescription ( tool , mockWritable as unknown as ChatStream )
209+ void ToolUtils . queueDescription ( tool , mockWritable as unknown as Writable , false )
213210
214- assert ( mockListDirectory . queueDescription . calledOnceWith ( mockChatStream ) )
211+ assert ( mockListDirectory . queueDescription . calledOnceWith ( mockWritable , false ) )
215212 } )
216213 } )
217214
0 commit comments