mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-09-30 20:49:41 +02:00
CLAUDE.md: tech-stack, envOverrides, and prefix-discipline sections now cover the Codex (OpenAI CLI) run mode merged in PR #114 (SessionMode 'codex', codex-cli-resolver, CODEX_* allowlist). test/setup.ts: strip CODEMAN_GESTURE like the auth vars — when the shell exports it, renderIndexHtml injects the gesture-availability flag and test/server-index-title.test.ts byte-identity assertions fail (1 spurious failure in an otherwise-green local test:ci sweep). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
26 lines
898 B
TypeScript
26 lines
898 B
TypeScript
/**
|
|
* @fileoverview Global test setup for Codeman tests
|
|
*
|
|
* SAFETY: TmuxManager has 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
|
|
* sessions regardless of what the test code does.
|
|
*
|
|
* This setup file strips shell-level auth configuration that can leak from a
|
|
* running Codeman instance, then handles mock/timer cleanup between tests.
|
|
*/
|
|
|
|
import { afterEach, vi } from 'vitest';
|
|
|
|
delete process.env.CODEMAN_PASSWORD;
|
|
delete process.env.CODEMAN_USERNAME;
|
|
// 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;
|
|
|
|
afterEach(() => {
|
|
vi.clearAllMocks();
|
|
vi.useRealTimers();
|
|
});
|