Skip to content

Commit 56bd900

Browse files
test: fail e2e test if peer dependencies are broken (#9241)
* test: fail e2e test if peer dependencies are broken * fixup! test: fail e2e test if peer dependencies are broken
1 parent 0dc7e3c commit 56bd900

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

packages/vite-plugin-cloudflare/e2e/helpers.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,13 @@ const testEnv = {
2929
VITEST: undefined,
3030
};
3131

32+
const strictPeerDeps = {
33+
pnpm: "--strict-peer-dependencies",
34+
npm: "--strict-peer-deps",
35+
// yarn does not have an option for strict checks
36+
yarn: "",
37+
};
38+
3239
/** Seed a test project from a fixture. */
3340
export function seed(fixture: string, pm: "pnpm" | "yarn" | "npm") {
3441
const root = inject("root");
@@ -42,7 +49,9 @@ export function seed(fixture: string, pm: "pnpm" | "yarn" | "npm") {
4249
debuglog("Fixture copied to " + projectPath);
4350
await updateVitePluginVersion(projectPath);
4451
debuglog("Updated vite-plugin version in package.json");
45-
runCommand(`${pm} install`, projectPath, { attempts: 2 });
52+
runCommand(`${pm} install ${strictPeerDeps[pm]}`, projectPath, {
53+
attempts: 2,
54+
});
4655
debuglog("Installed node modules");
4756
}, 200_000);
4857

0 commit comments

Comments
 (0)