mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-21 18:44:30 -07:00
fix(evals): add typecheck coverage for evals, integration-tests, and memory-tests (#25480)
This commit is contained in:
@@ -39,7 +39,11 @@ describe('web-fetch rate limiting', () => {
|
||||
const rateLimitedCalls = toolLogs.filter(
|
||||
(log) =>
|
||||
log.toolRequest.name === 'web_fetch' &&
|
||||
log.toolRequest.error?.includes('Rate limit exceeded'),
|
||||
(
|
||||
('error' in log.toolRequest
|
||||
? (log.toolRequest as unknown as Record<string, string>)['error']
|
||||
: '') as string
|
||||
)?.includes('Rate limit exceeded'),
|
||||
);
|
||||
|
||||
expect(rateLimitedCalls.length).toBeGreaterThan(0);
|
||||
|
||||
@@ -164,7 +164,8 @@ describe.skipIf(skipFlaky)(
|
||||
);
|
||||
expect(blockHook).toBeDefined();
|
||||
expect(
|
||||
blockHook?.hookCall.stdout + blockHook?.hookCall.stderr,
|
||||
(blockHook?.hookCall.stdout || '') +
|
||||
(blockHook?.hookCall.stderr || ''),
|
||||
).toContain(blockMsg);
|
||||
});
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ describe('Plan Mode', () => {
|
||||
).toBeDefined();
|
||||
expect(
|
||||
planWrite?.toolRequest.success,
|
||||
`Expected write_file to succeed, but it failed with error: ${planWrite?.toolRequest.error}`,
|
||||
`Expected write_file to succeed, but it failed with error: ${'error' in (planWrite?.toolRequest || {}) ? (planWrite?.toolRequest as unknown as Record<string, string>)['error'] : 'unknown'}`,
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
@@ -221,7 +221,7 @@ describe('Plan Mode', () => {
|
||||
).toBeDefined();
|
||||
expect(
|
||||
planWrite?.toolRequest.success,
|
||||
`Expected write_file to succeed, but it failed with error: ${planWrite?.toolRequest.error}`,
|
||||
`Expected write_file to succeed, but it failed with error: ${'error' in (planWrite?.toolRequest || {}) ? (planWrite?.toolRequest as unknown as Record<string, string>)['error'] : 'unknown'}`,
|
||||
).toBe(true);
|
||||
});
|
||||
it('should switch from a pro model to a flash model after exiting plan mode', async () => {
|
||||
@@ -270,13 +270,24 @@ describe('Plan Mode', () => {
|
||||
);
|
||||
|
||||
const apiRequests = rig.readAllApiRequest();
|
||||
const modelNames = apiRequests.map((r) => r.attributes?.model || 'unknown');
|
||||
const modelNames = apiRequests.map(
|
||||
(r) =>
|
||||
('model' in (r.attributes || {})
|
||||
? (r.attributes as unknown as Record<string, string>)['model']
|
||||
: 'unknown') || 'unknown',
|
||||
);
|
||||
|
||||
const proRequests = apiRequests.filter((r) =>
|
||||
r.attributes?.model?.includes('pro'),
|
||||
('model' in (r.attributes || {})
|
||||
? (r.attributes as unknown as Record<string, string>)['model']
|
||||
: 'unknown'
|
||||
)?.includes('pro'),
|
||||
);
|
||||
const flashRequests = apiRequests.filter((r) =>
|
||||
r.attributes?.model?.includes('flash'),
|
||||
('model' in (r.attributes || {})
|
||||
? (r.attributes as unknown as Record<string, string>)['model']
|
||||
: 'unknown'
|
||||
)?.includes('flash'),
|
||||
);
|
||||
|
||||
expect(
|
||||
|
||||
@@ -5,5 +5,9 @@
|
||||
"allowJs": true
|
||||
},
|
||||
"include": ["**/*.ts"],
|
||||
"references": [{ "path": "../packages/core" }]
|
||||
"references": [
|
||||
{ "path": "../packages/core" },
|
||||
{ "path": "../packages/test-utils" },
|
||||
{ "path": "../packages/cli" }
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user