Skip to content

Commit f15d0e3

Browse files
committed
chore: fix tests.
1 parent 586fe82 commit f15d0e3

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

packages/agent/src/core/toolAgent.test.ts

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -75,17 +75,21 @@ describe('toolAgent', () => {
7575
});
7676

7777
it('should handle unknown tools', async () => {
78-
await expect(
79-
executeToolCall(
80-
{
81-
id: '1',
82-
name: 'nonexistentTool',
83-
content: JSON.stringify({}),
84-
},
85-
[mockTool],
86-
toolContext,
87-
),
88-
).rejects.toThrow("No tool with the name 'nonexistentTool' exists.");
78+
const result = await executeToolCall(
79+
{
80+
id: '1',
81+
name: 'nonexistentTool',
82+
content: JSON.stringify({}),
83+
},
84+
[mockTool],
85+
toolContext,
86+
);
87+
88+
// Parse the result as JSON
89+
const parsedResult = JSON.parse(result);
90+
91+
// Check that it contains the expected error properties
92+
expect(parsedResult.error).toBe(true);
8993
});
9094

9195
it('should handle tool execution errors', async () => {

0 commit comments

Comments
 (0)