fix(tests): isolate Claude config dir from model tests

(cherry picked from commit e567ac31e5)
This commit is contained in:
Saul Moro
2026-09-28 17:32:41 +02:00
parent 23bebdd42c
commit 2e15c3f67c
2 changed files with 3 additions and 0 deletions
@@ -35,6 +35,7 @@ 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 = {};
@@ -53,6 +54,7 @@ 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];
+1
View File
@@ -203,6 +203,7 @@ 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();