From d8c5c7d4df407eaf4941fe67503746c0dd8bbe54 Mon Sep 17 00:00:00 2001 From: czlonkowski <56956555+czlonkowski@users.noreply.github.com> Date: Fri, 26 Sep 2025 19:15:29 +0200 Subject: [PATCH] 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. --- tests/unit/telemetry/batch-processor.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/unit/telemetry/batch-processor.test.ts b/tests/unit/telemetry/batch-processor.test.ts index e16f7e8..3339d47 100644 --- a/tests/unit/telemetry/batch-processor.test.ts +++ b/tests/unit/telemetry/batch-processor.test.ts @@ -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();