Skip to content

Commit

Permalink
test: run tests for version arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
F-Kublin committed Jan 15, 2025
1 parent 35bf9a6 commit 31900b1
Showing 1 changed file with 30 additions and 2 deletions.
32 changes: 30 additions & 2 deletions test/fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,21 @@ export const pnpmFixture = test.extend<TestContext>({
verbatimSymlinks: true,
});

await use(testDirectory);
const packageManagers = ["7.30.0", "8.6.0", "9.14.4"];
for (const packageManager of packageManagers) {
const packageJsonPath = path.join(testDirectory, "package.json");
const packageJson = JSON.parse(
await fs.readFile(packageJsonPath, "utf8"),
);
packageJson.packageManager = `pnpm@${packageManager}`;
await fs.writeFile(
packageJsonPath,
JSON.stringify(packageJson, null, 2),
"utf8",
);

await use(testDirectory);
}

await fs.rm(testDirectory, { recursive: true });
},
Expand All @@ -122,7 +136,21 @@ export const yarnFixture = test.extend<TestContext>({
recursive: true,
});

await use(testDirectory);
const packageManagers = ["1.22.22", "3.8.7"];
for (const packageManager of packageManagers) {
const packageJsonPath = path.join(testDirectory, "package.json");
const packageJson = JSON.parse(
await fs.readFile(packageJsonPath, "utf8"),
);
packageJson.packageManager = `yarn@${packageManager}`;
await fs.writeFile(
packageJsonPath,
JSON.stringify(packageJson, null, 2),
"utf8",
);

await use(testDirectory);
}

await fs.rm(testDirectory, { recursive: true });
},
Expand Down

0 comments on commit 31900b1

Please sign in to comment.