Skip to content

Commit 22cd716

Browse files
Test to make sure NPM wasn't run
1 parent 264413a commit 22cd716

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

test/specs/npm.spec.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,13 @@ describe("npm version hooks", () => {
136136
expect(bin[6].version).to.equal("2.0.0");
137137
});
138138

139-
it("should skip whichever version scripts present", () => {
139+
it("should skip all version scripts when --ignore-scripts is used", () => {
140140
files.create("package.json", {
141141
version: "1.2.3",
142142
scripts: {
143143
preversion: "echo preversion",
144144
version: "echo version",
145+
postversion: "echo postversion",
145146
}
146147
});
147148
files.create("package-lock.json", { version: "1.2.3" });
@@ -156,8 +157,9 @@ describe("npm version hooks", () => {
156157
`${check} Updated package-lock.json to 2.0.0\n`
157158
);
158159

159-
expect(files.json("package.json")).to.deep.equal({ version: "2.0.0", scripts: { preversion: "echo preversion", version: "echo version", }});
160-
expect(files.json("package-lock.json")).to.deep.equal({ version: "2.0.0" });
160+
// NPM should not have been run at all
161+
let npm = mocks.npm();
162+
expect(npm.length).to.equal(0);
161163
});
162164

163165
});

0 commit comments

Comments
 (0)