fix: remove the process env from the tests and fix the plugin manifest (#4927)

This commit is contained in:
Kartik
2026-04-22 22:57:44 +05:30
committed by GitHub
parent f5dc825d47
commit 282feaebf2
8 changed files with 91 additions and 65 deletions
+2 -5
View File
@@ -1738,9 +1738,7 @@ describe("registerCliCommands", () => {
const { mem0 } = setup();
const initCmd = findCommand(mem0, "init")!;
// Ensure env var is not set so validation fails
const savedEnv = process.env.OPENAI_API_KEY;
delete process.env.OPENAI_API_KEY;
vi.stubEnv("OPENAI_API_KEY", "");
await initCmd._action!({ mode: "open-source", ossLlm: "openai" });
@@ -1748,8 +1746,7 @@ describe("registerCliCommands", () => {
expect.stringContaining("--oss-llm-key"),
);
// Restore env var
if (savedEnv !== undefined) process.env.OPENAI_API_KEY = savedEnv;
vi.unstubAllEnvs();
});
});
});