test(cleanup): fix temporary directory leaks in test suites (#26217)

This commit is contained in:
Adib234
2026-05-04 15:08:02 -04:00
committed by GitHub
parent a7beb890d0
commit 75a8de83fc
4 changed files with 50 additions and 11 deletions
@@ -10,6 +10,7 @@ import * as path from 'node:path';
import * as os from 'node:os';
import { ExtensionManager } from './extension-manager.js';
import { createTestMergedSettings } from './settings.js';
import { cleanupTmpDir } from '@google/gemini-cli-test-utils';
import {
loadAgentsFromDirectory,
loadSkillsFromDir,
@@ -87,8 +88,9 @@ describe('ExtensionManager Settings Scope', () => {
);
});
afterEach(() => {
// Clean up files if needed, or rely on temp dir cleanup
afterEach(async () => {
await cleanupTmpDir(currentTempHome);
await cleanupTmpDir(tempWorkspace);
vi.clearAllMocks();
});