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:
@@ -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 () => {
|
||||
|
||||
Reference in New Issue
Block a user