diff options
| author | Tommaso Sciortino <[email protected]> | 2025-07-07 23:48:44 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-07-08 06:48:44 +0000 |
| commit | 4dab31f1c8f0f4025c5d6a81c1b64f711e066756 (patch) | |
| tree | 3db882e191862e4c24e5653167a756145b567759 /packages/core/src/tools/grep.test.ts | |
| parent | 137ffec3f6fe035b7edcb478e6c44e66fa593839 (diff) | |
Improve Function Call argument validation and typing (#2881)
Co-authored-by: N. Taylor Mullen <[email protected]>
Diffstat (limited to 'packages/core/src/tools/grep.test.ts')
| -rw-r--r-- | packages/core/src/tools/grep.test.ts | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/packages/core/src/tools/grep.test.ts b/packages/core/src/tools/grep.test.ts index ae629a52..75cf1d28 100644 --- a/packages/core/src/tools/grep.test.ts +++ b/packages/core/src/tools/grep.test.ts @@ -80,8 +80,8 @@ describe('GrepTool', () => { it('should return error if pattern is missing', () => { const params = { path: '.' } as unknown as GrepToolParams; - expect(grepTool.validateToolParams(params)).toContain( - 'Parameters failed schema validation', + expect(grepTool.validateToolParams(params)).toBe( + `params must have required property 'pattern'`, ); }); @@ -204,11 +204,11 @@ describe('GrepTool', () => { it('should return an error if params are invalid', async () => { const params = { path: '.' } as unknown as GrepToolParams; // Invalid: pattern missing const result = await grepTool.execute(params, abortSignal); - expect(result.llmContent).toContain( - 'Error: Invalid parameters provided. Reason: Parameters failed schema validation', + expect(result.llmContent).toBe( + "Error: Invalid parameters provided. Reason: params must have required property 'pattern'", ); - expect(result.returnDisplay).toContain( - 'Model provided invalid parameters. Error: Parameters failed schema validation', + expect(result.returnDisplay).toBe( + "Model provided invalid parameters. Error: params must have required property 'pattern'", ); }); }); |
