aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGravatar dave caruso <me@paperdave.net> 2023-10-12 02:03:02 -0700
committerGravatar dave caruso <me@paperdave.net> 2023-10-12 02:03:02 -0700
commit969da088f5db3258a803ec186012e30f992829b4 (patch)
treed14d7fbe83085b4ef3ea1ca370e2ef089f15ba50 /test
parentc50be68790782e82c268e80e1c5a31c5d8caf093 (diff)
downloadbun-969da088f5db3258a803ec186012e30f992829b4.tar.gz
bun-969da088f5db3258a803ec186012e30f992829b4.tar.zst
bun-969da088f5db3258a803ec186012e30f992829b4.zip
fix(install): re-evaluate overrides when removedbun-v1.0.6
Diffstat (limited to 'test')
-rw-r--r--test/cli/install/overrides.test.ts26
1 files changed, 25 insertions, 1 deletions
diff --git a/test/cli/install/overrides.test.ts b/test/cli/install/overrides.test.ts
index 60e300c36..bd4ee5cf7 100644
--- a/test/cli/install/overrides.test.ts
+++ b/test/cli/install/overrides.test.ts
@@ -162,4 +162,28 @@ test("changing overrides makes the lockfile changed, prevent frozen install", as
installExpectFail(tmp, ["install", "--frozen-lockfile"]);
});
-// frozen lockfile
+test("overrides reset when removed", async () => {
+ const tmp = mkdtempSync(join(tmpdir(), "bun-pm-test"));
+ writeFileSync(
+ join(tmp, "package.json"),
+ JSON.stringify({
+ overrides: {
+ bytes: "1.0.0",
+ },
+ }),
+ );
+ install(tmp, ["install", "express@4.18.2"]);
+ expect(versionOf(tmp, "node_modules/bytes/package.json")).toBe("1.0.0");
+
+ writeFileSync(
+ join(tmp, "package.json"),
+ JSON.stringify({
+ ...JSON.parse(readFileSync(join(tmp, "package.json")).toString()),
+ overrides: undefined,
+ }),
+ );
+ install(tmp, ["install"]);
+ expect(versionOf(tmp, "node_modules/bytes/package.json")).not.toBe("1.0.0");
+
+ ensureLockfileDoesntChangeOnBunI(tmp);
+});