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-06-10 16:23:57 +02:00
|
|
|
// Gesture availability changes renderIndexHtml output (injects the
|
|
|
|
|
// __codemanGestureAvailable flag), breaking byte-identity assertions
|
|
|
|
|
// (test/server-index-title.test.ts) when the shell exports CODEMAN_GESTURE=1.
|
|
|
|
|
delete process.env.CODEMAN_GESTURE;
|
2026-06-08 10:19:38 -04:00
|
|
|
|
2026-01-30 22:25:59 +01:00
|
|
|
afterEach(() => {
|
|
|
|
|
vi.clearAllMocks();
|
|
|
|
|
vi.useRealTimers();
|
|
|
|
|
});
|