fix(ci): stabilize npm shrinkwrap metadata

This commit is contained in:
Vincent Koc
2026-05-22 17:50:22 +02:00
parent 5cc0dbce86
commit 21bedd3964
10 changed files with 86 additions and 342 deletions

View File

@@ -5,6 +5,7 @@ import {
disableShrinkwrappedOverrideConflictSources,
exactOverrideRulesFromOverrides,
exactVersionFromOverrideSpec,
normalizeNpmVersionDrift,
parsePnpmPackageKey,
parseLockPackagePath,
} from "../../scripts/generate-npm-shrinkwrap.mjs";
@@ -103,4 +104,44 @@ describe("generate-npm-shrinkwrap", () => {
},
]);
});
it("normalizes npm patch-version metadata drift", () => {
expect(
normalizeNpmVersionDrift({
packages: {
"node_modules/@rollup/rollup-linux-x64-gnu": {
version: "4.53.5",
cpu: ["x64"],
libc: ["glibc"],
optional: true,
os: ["linux"],
},
"node_modules/zod": {
version: "4.4.3",
peer: true,
},
"node_modules/keeps-peer-false": {
version: "1.0.0",
peer: false,
},
},
}),
).toEqual({
packages: {
"node_modules/@rollup/rollup-linux-x64-gnu": {
version: "4.53.5",
cpu: ["x64"],
optional: true,
os: ["linux"],
},
"node_modules/zod": {
version: "4.4.3",
},
"node_modules/keeps-peer-false": {
version: "1.0.0",
peer: false,
},
},
});
});
});