mirror of
https://github.com/moltbot/moltbot.git
synced 2026-05-13 15:47:28 +00:00
test: tighten managed npm repair command assertion
This commit is contained in:
@@ -389,24 +389,21 @@ describe("managed npm root", () => {
|
||||
|
||||
const runCommand = vi.fn().mockResolvedValue(successfulSpawn);
|
||||
await expect(repairManagedNpmRootOpenClawPeer({ npmRoot, runCommand })).resolves.toBe(true);
|
||||
expect(runCommand).toHaveBeenCalledWith(
|
||||
[
|
||||
"npm",
|
||||
"uninstall",
|
||||
"--loglevel=error",
|
||||
"--legacy-peer-deps",
|
||||
"--ignore-scripts",
|
||||
"--no-audit",
|
||||
"--no-fund",
|
||||
"openclaw",
|
||||
],
|
||||
expect.objectContaining({
|
||||
cwd: npmRoot,
|
||||
env: expect.objectContaining({
|
||||
npm_config_legacy_peer_deps: "true",
|
||||
}),
|
||||
}),
|
||||
);
|
||||
expect(runCommand).toHaveBeenCalledTimes(1);
|
||||
const [repairArgs, repairOptions] = runCommand.mock.calls[0];
|
||||
expect(repairArgs).toEqual([
|
||||
"npm",
|
||||
"uninstall",
|
||||
"--loglevel=error",
|
||||
"--legacy-peer-deps",
|
||||
"--ignore-scripts",
|
||||
"--no-audit",
|
||||
"--no-fund",
|
||||
"openclaw",
|
||||
]);
|
||||
expect(repairOptions?.cwd).toBe(npmRoot);
|
||||
expect(repairOptions?.timeoutMs).toBe(300_000);
|
||||
expect(repairOptions?.env?.npm_config_legacy_peer_deps).toBe("true");
|
||||
|
||||
const manifest = JSON.parse(await fs.readFile(path.join(npmRoot, "package.json"), "utf8")) as {
|
||||
dependencies?: Record<string, string>;
|
||||
|
||||
Reference in New Issue
Block a user