test: mock Unix platform for SIGTERM behavior in ClaudeUsageService tests

Added a mock for the Unix platform in the SIGTERM test case to ensure proper behavior during testing on non-Windows systems. This change enhances the reliability of the tests by simulating the expected environment for process termination.
This commit is contained in:
Kacper
2026-01-16 20:38:29 +01:00
parent 0e9369816f
commit 98c50d44a4

View File

@@ -586,6 +586,8 @@ Resets in 2h
it('should send SIGTERM after ESC if process does not exit', async () => {
vi.useFakeTimers();
// Mock Unix platform to test SIGTERM behavior (Windows calls kill() without signal)
vi.mocked(os.platform).mockReturnValue('darwin');
const ptyService = new ClaudeUsageService();
let dataCallback: Function | undefined;