diff --git a/libs/platform/tests/subprocess.test.ts b/libs/platform/tests/subprocess.test.ts index f7a55286..099d084d 100644 --- a/libs/platform/tests/subprocess.test.ts +++ b/libs/platform/tests/subprocess.test.ts @@ -20,6 +20,7 @@ async function collectAsyncGenerator(generator: AsyncGenerator): Promise { let consoleSpy: { log: ReturnType; + warn: ReturnType; error: ReturnType; }; @@ -27,12 +28,14 @@ describe('subprocess.ts', () => { vi.clearAllMocks(); consoleSpy = { log: vi.spyOn(console, 'log').mockImplementation(() => {}), + warn: vi.spyOn(console, 'warn').mockImplementation(() => {}), error: vi.spyOn(console, 'error').mockImplementation(() => {}), }; }); afterEach(() => { consoleSpy.log.mockRestore(); + consoleSpy.warn.mockRestore(); consoleSpy.error.mockRestore(); }); @@ -176,11 +179,11 @@ describe('subprocess.ts', () => { const generator = spawnJSONLProcess(baseOptions); await collectAsyncGenerator(generator); - expect(consoleSpy.error).toHaveBeenCalledWith( - expect.stringContaining('Warning: something happened') + expect(consoleSpy.warn).toHaveBeenCalledWith( + expect.stringContaining('[SubprocessManager] stderr: Warning: something happened') ); - expect(consoleSpy.error).toHaveBeenCalledWith( - expect.stringContaining('Error: critical issue') + expect(consoleSpy.warn).toHaveBeenCalledWith( + expect.stringContaining('[SubprocessManager] stderr: Error: critical issue') ); });