Improve Function Call argument validation and typing (#2881)

Co-authored-by: N. Taylor Mullen <ntaylormullen@google.com>
This commit is contained in:
Tommaso Sciortino
2025-07-07 23:48:44 -07:00
committed by GitHub
parent 137ffec3f6
commit 4dab31f1c8
22 changed files with 239 additions and 246 deletions

View File

@@ -181,8 +181,8 @@ describe('GlobTool', () => {
// Need to correctly define this as an object without pattern
const params = { path: '.' };
// @ts-expect-error - We're intentionally creating invalid params for testing
expect(globTool.validateToolParams(params)).toContain(
'Parameters failed schema validation',
expect(globTool.validateToolParams(params)).toBe(
`params must have required property 'pattern'`,
);
});
@@ -206,8 +206,8 @@ describe('GlobTool', () => {
path: 123,
};
// @ts-expect-error - We're intentionally creating invalid params for testing
expect(globTool.validateToolParams(params)).toContain(
'Parameters failed schema validation',
expect(globTool.validateToolParams(params)).toBe(
'params/path must be string',
);
});
@@ -217,8 +217,8 @@ describe('GlobTool', () => {
case_sensitive: 'true',
};
// @ts-expect-error - We're intentionally creating invalid params for testing
expect(globTool.validateToolParams(params)).toContain(
'Parameters failed schema validation',
expect(globTool.validateToolParams(params)).toBe(
'params/case_sensitive must be boolean',
);
});