test: migrate test suite from Jest to Bun test framework
- Convert test files to use Bun's test framework and mocking utilities - Update import statements and test syntax - Add comprehensive test utilities and mock implementations - Create test migration guide documentation - Implement helper functions for consistent test setup and teardown - Add type definitions for improved type safety in tests
This commit is contained in:
12
src/utils/helpers.ts
Normal file
12
src/utils/helpers.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Formats a tool call response into a standardized structure
|
||||
* @param obj The object to format
|
||||
* @param isError Whether this is an error response
|
||||
* @returns Formatted response object
|
||||
*/
|
||||
export const formatToolCall = (obj: any, isError: boolean = false) => {
|
||||
const text = obj === undefined ? 'undefined' : JSON.stringify(obj, null, 2);
|
||||
return {
|
||||
content: [{ type: "text", text, isError }],
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user