test(plugins): narrow npm install mock options

This commit is contained in:
Vincent Koc
2026-06-17 12:30:52 +08:00
parent 41a0b8df36
commit 80c47ecb99

View File

@@ -427,6 +427,9 @@ function mockSuccessfulManagedNpmInstall(params: { packageName: string; version?
throw new Error(`unexpected command: ${args.join(" ")}`);
}
if (!args.includes("--package-lock-only")) {
if (typeof options === "number") {
throw new Error("expected npm install options object");
}
const npmRoot = options.cwd;
if (!npmRoot) {
throw new Error("expected npm install cwd");