Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/__tests__/helpers/clear-agent-session-env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,11 @@ import { AGENT_SESSION_ENV } from '../../utils/session-id.js';
for (const name of AGENT_SESSION_ENV) {
delete process.env[name];
}

// The same shell may relocate an agent's root (CLAUDE_CONFIG_DIR, COPILOT_HOME,
// OPENCLAW_STATE_DIR), which teamai honors, so a test that stubs only HOME
// would still read, write or remove the developer's real Claude Code, Copilot
// or OpenClaw files. A test that needs one sets it.
for (const name of ['CLAUDE_CONFIG_DIR', 'COPILOT_HOME', 'OPENCLAW_STATE_DIR']) {
delete process.env[name];
}
2 changes: 0 additions & 2 deletions src/__tests__/local-agent-model-config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ let originalGuardedEnv: Record<string, string | undefined>;

beforeEach(async () => {
home = await fse.mkdtemp(path.join(os.tmpdir(), 'teamai-model-config-'));
vi.stubEnv('CLAUDE_CONFIG_DIR', undefined);
originalHome = process.env.HOME;
process.env.HOME = home;
originalGuardedEnv = {};
Expand All @@ -54,7 +53,6 @@ beforeEach(async () => {

afterEach(async () => {
process.env.HOME = originalHome;
vi.unstubAllEnvs();
for (const key of GUARDED_ENV_KEYS) {
const value = originalGuardedEnv[key];
if (value === undefined) delete process.env[key];
Expand Down
1 change: 0 additions & 1 deletion src/__tests__/uninstall.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,6 @@ describe('uninstall', () => {

beforeEach(async () => {
tmpDir = await fse.mkdtemp(path.join(os.tmpdir(), 'teamai-uninstall-test-'));
vi.stubEnv('CLAUDE_CONFIG_DIR', undefined);
mockAutoDetectInit.mockReset();
mockReconcileHooks.mockReset();
mockSaveLocalConfig.mockReset();
Expand Down
Loading