2026-01-22 11:30:10 +01:00
|
|
|
/**
|
2026-02-26 16:44:34 +01:00
|
|
|
* @fileoverview Global test setup for Codeman tests
|
2026-01-22 11:30:10 +01:00
|
|
|
*
|
2026-02-18 12:51:35 +01:00
|
|
|
* SAFETY: TmuxManager has built-in test mode detection
|
2026-02-12 18:26:16 +01:00
|
|
|
* (via process.env.VITEST) that makes ALL shell commands no-ops.
|
2026-02-18 12:51:35 +01:00
|
|
|
* This means tests CANNOT kill, create, or interact with real tmux
|
2026-02-12 18:26:16 +01:00
|
|
|
* sessions regardless of what the test code does.
|
2026-01-22 19:24:36 +01:00
|
|
|
*
|
2026-06-08 10:19:38 -04:00
|
|
|
* This setup file strips shell-level auth configuration that can leak from a
|
|
|
|
|
* running Codeman instance, then handles mock/timer cleanup between tests.
|
2026-01-22 11:30:10 +01:00
|
|
|
*/
|
|
|
|
|
|
2026-02-12 18:26:16 +01:00
|
|
|
import { afterEach, vi } from 'vitest';
|
2026-01-22 11:30:10 +01:00
|
|
|
|
2026-06-08 10:19:38 -04:00
|
|
|
delete process.env.CODEMAN_PASSWORD;
|
|
|
|
|
delete process.env.CODEMAN_USERNAME;
|
|
|
|
|
|
2026-01-30 22:25:59 +01:00
|
|
|
afterEach(() => {
|
|
|
|
|
vi.clearAllMocks();
|
|
|
|
|
vi.useRealTimers();
|
|
|
|
|
});
|