refactor: update TypeScript configuration and test utilities for improved type safety

- Modify tsconfig.json to relax strict type checking for gradual migration
- Update test files to use more flexible type checking and mocking
- Add type-safe mock and test utility functions
- Improve error handling and type inference in test suites
- Export Tool interface and tools list for better testing support
This commit is contained in:
jango-blockchained
2025-02-05 09:16:21 +01:00
parent eefbf790c3
commit 4e9ebbbc2c
21 changed files with 526 additions and 532 deletions

View File

@@ -141,8 +141,9 @@ export const cleanupMocks = (mocks: {
liteMcpInstance: MockLiteMCPInstance;
mockFetch: Mock<() => Promise<Response>>;
}) => {
mocks.liteMcpInstance.addTool.mock.calls = [];
mocks.liteMcpInstance.start.mock.calls = [];
// Reset mock calls by creating a new mock
mocks.liteMcpInstance.addTool = mock((tool: Tool) => undefined);
mocks.liteMcpInstance.start = mock(() => Promise.resolve());
mocks.mockFetch = mock(() => Promise.resolve(new Response()));
globalThis.fetch = mocks.mockFetch;
};