mirror of
https://github.com/czlonkowski/n8n-mcp.git
synced 2026-02-06 05:23:08 +00:00
fix: TypeScript compilation errors in test-automator generated tests
Fixed 29 TypeScript compilation errors in test files: **breaking-change-detector.test.ts** (22 errors): - Added missing `nodeType`, `fromVersion`, `toVersion` to BreakingChange objects - All 22 BreakingChange object instantiations now comply with interface **node-migration-service.test.ts** (3 errors): - Added type assertions for dynamic property assignment in tests - Lines 310, 396, 519: `(node as any).property = value` **workflow-versioning-service.test.ts** (5 errors): - Fixed N8nApiClient constructor: takes config object, not separate params - Fixed updateWorkflow mock: returns Workflow object, not undefined All tests now compile successfully with `npm run typecheck`. Conceived by Romuald Członkowski - www.aiadvisors.pl/en 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -38,7 +38,7 @@ describe('WorkflowVersioningService', () => {
|
||||
beforeEach(() => {
|
||||
vi.clearAllMocks();
|
||||
mockRepository = new NodeRepository({} as any);
|
||||
mockApiClient = new N8nApiClient('http://test', 'test-key');
|
||||
mockApiClient = new N8nApiClient({ baseUrl: 'http://test', apiKey: 'test-key' });
|
||||
service = new WorkflowVersioningService(mockRepository, mockApiClient);
|
||||
});
|
||||
|
||||
@@ -221,7 +221,7 @@ describe('WorkflowVersioningService', () => {
|
||||
vi.spyOn(mockRepository, 'createWorkflowVersion').mockReturnValue(4);
|
||||
vi.spyOn(mockRepository, 'pruneWorkflowVersions').mockReturnValue(0);
|
||||
vi.spyOn(mockApiClient, 'getWorkflow').mockResolvedValue(createMockWorkflow('workflow-1', 'Current'));
|
||||
vi.spyOn(mockApiClient, 'updateWorkflow').mockResolvedValue(undefined);
|
||||
vi.spyOn(mockApiClient, 'updateWorkflow').mockResolvedValue(createMockWorkflow('workflow-1', 'Restored'));
|
||||
|
||||
const result = await service.restoreVersion('workflow-1', undefined, false);
|
||||
|
||||
@@ -266,7 +266,7 @@ describe('WorkflowVersioningService', () => {
|
||||
vi.spyOn(mockRepository, 'createWorkflowVersion').mockReturnValue(2);
|
||||
vi.spyOn(mockRepository, 'pruneWorkflowVersions').mockReturnValue(0);
|
||||
vi.spyOn(mockApiClient, 'getWorkflow').mockResolvedValue(createMockWorkflow('workflow-1', 'Current'));
|
||||
vi.spyOn(mockApiClient, 'updateWorkflow').mockResolvedValue(undefined);
|
||||
vi.spyOn(mockApiClient, 'updateWorkflow').mockResolvedValue(createMockWorkflow('workflow-1', 'Restored'));
|
||||
|
||||
const mockValidator = vi.fn();
|
||||
vi.spyOn(WorkflowValidator.prototype, 'validateWorkflow').mockImplementation(mockValidator);
|
||||
@@ -285,7 +285,7 @@ describe('WorkflowVersioningService', () => {
|
||||
vi.spyOn(mockRepository, 'createWorkflowVersion').mockReturnValue(3);
|
||||
vi.spyOn(mockRepository, 'pruneWorkflowVersions').mockReturnValue(0);
|
||||
vi.spyOn(mockApiClient, 'getWorkflow').mockResolvedValue(currentWorkflow);
|
||||
vi.spyOn(mockApiClient, 'updateWorkflow').mockResolvedValue(undefined);
|
||||
vi.spyOn(mockApiClient, 'updateWorkflow').mockResolvedValue(createMockWorkflow('workflow-1', 'Restored'));
|
||||
|
||||
const result = await service.restoreVersion('workflow-1', 1, false);
|
||||
|
||||
@@ -322,7 +322,7 @@ describe('WorkflowVersioningService', () => {
|
||||
vi.spyOn(mockRepository, 'createWorkflowVersion').mockReturnValue(3);
|
||||
vi.spyOn(mockRepository, 'pruneWorkflowVersions').mockReturnValue(0);
|
||||
vi.spyOn(mockApiClient, 'getWorkflow').mockResolvedValue(createMockWorkflow('workflow-1', 'Current'));
|
||||
vi.spyOn(mockApiClient, 'updateWorkflow').mockResolvedValue(undefined);
|
||||
vi.spyOn(mockApiClient, 'updateWorkflow').mockResolvedValue(createMockWorkflow('workflow-1', 'Restored'));
|
||||
|
||||
const result = await service.restoreVersion('workflow-1', 1, false);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user