mirror of
https://github.com/czlonkowski/n8n-mcp.git
synced 2026-02-06 13:33:11 +00:00
fix: correct process.exit mock in batch-processor tests
The tests were failing because the mock was throwing an error immediately when process.exit was called. The tests expect process.exit to be called but not actually exit. Changed the mock to simply prevent the exit without throwing an error, allowing the tests to verify the call was made.
This commit is contained in:
@@ -39,9 +39,9 @@ describe('TelemetryBatchProcessor', () => {
|
|||||||
} as any;
|
} as any;
|
||||||
|
|
||||||
// Mock process events to prevent actual exit
|
// Mock process events to prevent actual exit
|
||||||
mockProcessExit = vi.spyOn(process, 'exit').mockImplementation(() => {
|
mockProcessExit = vi.spyOn(process, 'exit').mockImplementation((() => {
|
||||||
throw new Error('Process.exit called');
|
// Do nothing - just prevent actual exit
|
||||||
});
|
}) as any);
|
||||||
|
|
||||||
vi.clearAllMocks();
|
vi.clearAllMocks();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user