mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-19 09:33:53 +00:00
feat(errors): Make errors more informative (#7133)
This commit is contained in:
@@ -48,6 +48,7 @@ vi.mock('@google/gemini-cli-core', async () => {
|
||||
|
||||
const mockToolRegistry = {
|
||||
getTool: vi.fn(),
|
||||
getAllToolNames: vi.fn(() => ['mockTool', 'anotherTool']),
|
||||
};
|
||||
|
||||
const mockConfig = {
|
||||
@@ -427,11 +428,17 @@ describe('useReactToolScheduler', () => {
|
||||
request,
|
||||
response: expect.objectContaining({
|
||||
error: expect.objectContaining({
|
||||
message: 'Tool "nonexistentTool" not found in registry.',
|
||||
message: expect.stringMatching(
|
||||
/Tool "nonexistentTool" not found in registry/,
|
||||
),
|
||||
}),
|
||||
}),
|
||||
}),
|
||||
]);
|
||||
const errorMessage = onComplete.mock.calls[0][0][0].response.error.message;
|
||||
expect(errorMessage).toContain('Did you mean one of:');
|
||||
expect(errorMessage).toContain('"mockTool"');
|
||||
expect(errorMessage).toContain('"anotherTool"');
|
||||
expect(result.current[0]).toEqual([]);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user