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:
czlonkowski
2025-09-26 19:15:29 +02:00
parent 2716207d72
commit d8c5c7d4df

View File

@@ -39,9 +39,9 @@ describe('TelemetryBatchProcessor', () => {
} as any;
// Mock process events to prevent actual exit
mockProcessExit = vi.spyOn(process, 'exit').mockImplementation(() => {
throw new Error('Process.exit called');
});
mockProcessExit = vi.spyOn(process, 'exit').mockImplementation((() => {
// Do nothing - just prevent actual exit
}) as any);
vi.clearAllMocks();