test(discovery): cleared inherited CLAUDE_CONFIG_DIR in setup

Legacy-path Claude discovery tests now unset an inherited override in beforeEach so they read the fixtures under their temp homes; relocation cases still set it explicitly.
This commit is contained in:
roboomp
2026-08-13 15:51:06 +00:00
parent 406306f972
commit 3e4b59fa94
3 changed files with 7 additions and 0 deletions
@@ -25,6 +25,7 @@ describe("Claude Code slash command discovery", () => {
resetSettingsForTest();
originalHome = process.env.HOME;
originalClaudeConfigDir = process.env.CLAUDE_CONFIG_DIR;
delete process.env.CLAUDE_CONFIG_DIR;
root = await fs.mkdtemp(path.join(os.tmpdir(), "omp-claude-commands-"));
home = path.join(root, "home");
project = path.join(root, "project");
@@ -86,6 +86,7 @@ describe("listClaudePluginRoots", () => {
originalOmpProfileEnv = process.env.OMP_PROFILE;
originalPiProfileEnv = process.env.PI_PROFILE;
originalClaudeConfigDir = process.env.CLAUDE_CONFIG_DIR;
delete process.env.CLAUDE_CONFIG_DIR;
tempDir = await fs.mkdtemp(path.join(os.tmpdir(), "claude-plugins-test-"));
testAgentDir = await fs.mkdtemp(path.join(os.tmpdir(), "claude-plugins-test-agent-"));
process.env.HOME = tempDir;
@@ -1378,15 +1379,19 @@ describe("listClaudePluginRoots", () => {
describe("discoverAgents plugin precedence", () => {
let tempDir: string;
let originalClaudeConfigDir: string | undefined;
beforeEach(async () => {
clearClaudePluginRootsCache();
clearFsCache();
originalClaudeConfigDir = process.env.CLAUDE_CONFIG_DIR;
delete process.env.CLAUDE_CONFIG_DIR;
tempDir = await fs.mkdtemp(path.join(os.tmpdir(), "claude-plugins-precedence-test-"));
});
afterEach(async () => {
clearClaudePluginRootsCache();
restoreEnvValue("CLAUDE_CONFIG_DIR", originalClaudeConfigDir);
await removeWithRetries(tempDir);
});
@@ -17,6 +17,7 @@ let originalClaudeConfigDir: string | undefined;
beforeEach(async () => {
tempRoot = await fs.mkdtemp(path.join(os.tmpdir(), "omp-foreign-sessions-"));
originalClaudeConfigDir = process.env.CLAUDE_CONFIG_DIR;
delete process.env.CLAUDE_CONFIG_DIR;
});
afterEach(async () => {