mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-02 05:29:42 +02:00
Added IS_TEST_MODE (process.env.VITEST) guards to every method in TmuxManager and ScreenManager that touches real tmux/screen sessions. Tests can never create, kill, discover, or send input to real sessions. Removed broken E2E test suite entirely. Rewrote test/setup.ts from 459 lines to minimal cleanup. Rewrote tmux-related tests to verify test-mode safety behavior. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
18 lines
510 B
TypeScript
18 lines
510 B
TypeScript
/**
|
|
* @fileoverview Global test setup for Claudeman tests
|
|
*
|
|
* SAFETY: TmuxManager and ScreenManager have built-in test mode detection
|
|
* (via process.env.VITEST) that makes ALL shell commands no-ops.
|
|
* This means tests CANNOT kill, create, or interact with real tmux/screen
|
|
* sessions regardless of what the test code does.
|
|
*
|
|
* This setup file only handles mock/timer cleanup between tests.
|
|
*/
|
|
|
|
import { afterEach, vi } from 'vitest';
|
|
|
|
afterEach(() => {
|
|
vi.clearAllMocks();
|
|
vi.useRealTimers();
|
|
});
|