mirror of
https://github.com/czlonkowski/n8n-mcp.git
synced 2026-02-06 05:23:08 +00:00
fix: resolve LRU cache test failures and TypeScript linting errors
- Fix module resolution issues in LRU cache tests by using proper vi.mock() with importActual - Fix mock call count expectations by using valid API keys instead of empty strings - Add explicit types to test objects to resolve TypeScript linting errors - Change logger mock types to 'any' to avoid complex type issues - Add vi.clearAllMocks() for proper test isolation All tests now pass and TypeScript linting succeeds without errors. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -187,7 +187,7 @@ describe('handlers-n8n-manager Simple Coverage Tests', () => {
|
||||
|
||||
describe('Array and Object Handling', () => {
|
||||
it('should handle undefined array lengths', () => {
|
||||
const workflowData = {
|
||||
const workflowData: { nodes?: any[] } = {
|
||||
nodes: undefined
|
||||
};
|
||||
|
||||
@@ -283,7 +283,7 @@ describe('handlers-n8n-manager Simple Coverage Tests', () => {
|
||||
});
|
||||
|
||||
it('should handle missing dependencies', () => {
|
||||
const packageJson = {};
|
||||
const packageJson: { dependencies?: { n8n?: string } } = {};
|
||||
|
||||
const supportedVersion = packageJson.dependencies?.n8n?.replace(/[^0-9.]/g, '') || '';
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ vi.mock('../../../src/types/instance-context', async () => {
|
||||
describe('LRU Cache Behavior Tests', () => {
|
||||
let mockN8nApiClient: Mock;
|
||||
let mockGetN8nApiConfigFromContext: Mock;
|
||||
let mockLogger: Mock;
|
||||
let mockLogger: any; // Logger mock has complex type
|
||||
let mockValidateInstanceContext: Mock;
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
Reference in New Issue
Block a user