diff options
| author | joshualitt <[email protected]> | 2025-08-13 12:27:09 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-08-13 19:27:09 +0000 |
| commit | c0c0e9b7a0a768515181e6ae7defe9f06199ea18 (patch) | |
| tree | bb25174f46c5ab54d2f4d1bcd5d6ca98478ce72a /packages/core/src/tools/web-fetch.test.ts | |
| parent | 904f4623b6945345d5845649e98f554671b1edfb (diff) | |
feat(core): Migrate read_many_files, shell, and web_fetch. (#6167)
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 && |
