Skip to content

Commit

Permalink
test: add --lockfile-only param for pnpm
Browse files Browse the repository at this point in the history
  • Loading branch information
F-Kublin committed Dec 13, 2024
1 parent 63fa8a9 commit d31798c
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions test/utils/add-to-package-json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,20 @@ export const addToPackageJson = async (
);

const installCommand = await getInstallCommand(testDirectory);
try {
await execAsync(installCommand, { cwd: testDirectory });
} catch (err) {
console.log("ERROR: ", err);
if (await exists(path.resolve(testDirectory, "pnpm-lock.yaml"))) {
try {
await execAsync(`${installCommand} --lockfile-only`, {
cwd: testDirectory,
});
} catch (err) {
console.log("ERROR: ", err);
}
} else {
try {
await execAsync(installCommand, { cwd: testDirectory });
} catch (err) {
console.log("ERROR: ", err);
}
}

await addPackage(testDirectory, depName, packageDetails, licenseFiles);
Expand Down

0 comments on commit d31798c

Please sign in to comment.