mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 10:50:44 +00:00
fix(plugins): ignore inherited npm dry-run for runtime deps
This commit is contained in:
@@ -142,10 +142,12 @@ describe("bundled plugin postinstall", () => {
|
||||
expect(
|
||||
createBundledRuntimeDependencyInstallEnv({
|
||||
HOME: "/tmp/home",
|
||||
npm_config_dry_run: "true",
|
||||
npm_config_prefix: "/opt/homebrew",
|
||||
}),
|
||||
).toEqual({
|
||||
HOME: "/tmp/home",
|
||||
npm_config_dry_run: "false",
|
||||
npm_config_legacy_peer_deps: "true",
|
||||
npm_config_package_lock: "false",
|
||||
npm_config_save: "false",
|
||||
|
||||
@@ -155,6 +155,31 @@ describe("stageBundledPluginRuntimeDeps", () => {
|
||||
);
|
||||
});
|
||||
|
||||
it("forces fallback runtime installs off inherited npm dry-run mode", () => {
|
||||
const spawnSyncImpl = vi.fn(() => ({ status: 0, stderr: "", stdout: "" }));
|
||||
|
||||
stageBundledPluginRuntimeDepsTesting.runNpmInstall({
|
||||
cwd: "/tmp/openclaw-runtime-deps",
|
||||
npmRunner: {
|
||||
command: "npm",
|
||||
args: ["install"],
|
||||
env: { PATH: "/usr/bin", npm_config_dry_run: "true" },
|
||||
shell: false,
|
||||
},
|
||||
spawnSyncImpl,
|
||||
});
|
||||
|
||||
expect(spawnSyncImpl).toHaveBeenCalledWith(
|
||||
"npm",
|
||||
["install"],
|
||||
expect.objectContaining({
|
||||
env: expect.objectContaining({
|
||||
npm_config_dry_run: "false",
|
||||
}),
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it("skips restaging when runtime deps stamp matches the sanitized manifest", () => {
|
||||
const { pluginDir, repoRoot } = createBundledPluginFixture({
|
||||
packageJson: {
|
||||
|
||||
Reference in New Issue
Block a user