diff options
Diffstat (limited to 'packages/core/src/tools/web-fetch.test.ts')
| -rw-r--r-- | packages/core/src/tools/web-fetch.test.ts | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/packages/core/src/tools/web-fetch.test.ts b/packages/core/src/tools/web-fetch.test.ts index 6be9d504..b589c139 100644 --- a/packages/core/src/tools/web-fetch.test.ts +++ b/packages/core/src/tools/web-fetch.test.ts @@ -20,7 +20,10 @@ describe('WebFetchTool', () => { it('should return confirmation details with the correct prompt and urls', async () => { const tool = new WebFetchTool(mockConfig); const params = { prompt: 'fetch https://example.com' }; - const confirmationDetails = await tool.shouldConfirmExecute(params); + const invocation = tool.build(params); + const confirmationDetails = await invocation.shouldConfirmExecute( + new AbortController().signal, + ); expect(confirmationDetails).toEqual({ type: 'info', @@ -37,7 +40,10 @@ describe('WebFetchTool', () => { prompt: 'fetch https://github.com/google/gemini-react/blob/main/README.md', }; - const confirmationDetails = await tool.shouldConfirmExecute(params); + const invocation = tool.build(params); + const confirmationDetails = await invocation.shouldConfirmExecute( + new AbortController().signal, + ); expect(confirmationDetails).toEqual({ type: 'info', @@ -57,7 +63,10 @@ describe('WebFetchTool', () => { getApprovalMode: () => ApprovalMode.AUTO_EDIT, } as unknown as Config); const params = { prompt: 'fetch https://example.com' }; - const confirmationDetails = await tool.shouldConfirmExecute(params); + const invocation = tool.build(params); + const confirmationDetails = await invocation.shouldConfirmExecute( + new AbortController().signal, + ); expect(confirmationDetails).toBe(false); }); @@ -69,7 +78,10 @@ describe('WebFetchTool', () => { setApprovalMode, } as unknown as Config); const params = { prompt: 'fetch https://example.com' }; - const confirmationDetails = await tool.shouldConfirmExecute(params); + const invocation = tool.build(params); + const confirmationDetails = await invocation.shouldConfirmExecute( + new AbortController().signal, + ); if ( confirmationDetails && |
