Skip to content

Commit 7ddae30

Browse files
committed
Fix unit tests
1 parent d450fb0 commit 7ddae30

File tree

2 files changed

+17
-10
lines changed

2 files changed

+17
-10
lines changed

test/specs/action/success.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ describe("GitHub Action - success tests", () => {
300300
});
301301

302302
expect(cli).to.have.stderr("");
303-
expect(cli).stdout.to.include("::set-output name=type::dry-run");
303+
expect(cli).stdout.to.include("::set-output name=type::minor");
304304
expect(cli).stdout.to.include("::set-output name=version::1.1.0");
305305
expect(cli).stdout.to.include("::set-output name=old-version::1.0.0");
306306
expect(cli).stdout.to.include("my-lib 1.1.0");

test/specs/lib/success.spec.js

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ describe("NPM package - success tests", () => {
5151
type: "major",
5252
package: "my-lib",
5353
version: "2.0.0",
54-
oldVersion: "1.0.0"
54+
oldVersion: "1.0.0",
55+
dryRun: false
5556
});
5657

5758
files.assert.contents("home/.npmrc",
@@ -83,7 +84,8 @@ describe("NPM package - success tests", () => {
8384
type: "none",
8485
package: "my-lib",
8586
version: "1.0.0",
86-
oldVersion: "1.0.0"
87+
oldVersion: "1.0.0",
88+
dryRun: false
8789
});
8890

8991
files.assert.contents("home/.npmrc",
@@ -129,7 +131,8 @@ describe("NPM package - success tests", () => {
129131
type: "prerelease",
130132
package: "my-lib",
131133
version: "1.0.0-beta.1",
132-
oldVersion: "1.0.0"
134+
oldVersion: "1.0.0",
135+
dryRun: false
133136
});
134137

135138
files.assert.contents("home/.npmrc",
@@ -172,7 +175,8 @@ describe("NPM package - success tests", () => {
172175
type: "minor",
173176
package: "my-lib",
174177
version: "1.1.0",
175-
oldVersion: "1.0.0"
178+
oldVersion: "1.0.0",
179+
dryRun: false
176180
});
177181

178182
files.assert.contents("home/.npmrc",
@@ -231,7 +235,8 @@ describe("NPM package - success tests", () => {
231235
type: "patch",
232236
package: "my-lib",
233237
version: "1.0.1",
234-
oldVersion: "1.0.0"
238+
oldVersion: "1.0.0",
239+
dryRun: false
235240
});
236241

237242
files.assert.contents("home/.npmrc",
@@ -284,7 +289,8 @@ describe("NPM package - success tests", () => {
284289
type: "prerelease",
285290
package: "my-lib",
286291
version: "1.0.0-beta",
287-
oldVersion: "1.0.0"
292+
oldVersion: "1.0.0",
293+
dryRun: false
288294
});
289295

290296
files.assert.contents("home/.npmrc",
@@ -295,7 +301,7 @@ describe("NPM package - success tests", () => {
295301
npm.assert.ran(4);
296302
});
297303

298-
it("should return a type of dry-run when called with --dry-run", async () => {
304+
it("results.dryRun should be true when called with --dry-run", async () => {
299305
files.create([
300306
{ path: "workspace/package.json", contents: { name: "my-lib", version: "1.1.0" }},
301307
]);
@@ -327,10 +333,11 @@ describe("NPM package - success tests", () => {
327333
});
328334

329335
expect(results).to.deep.equal({
330-
type: "dry-run",
336+
type: "minor",
331337
package: "my-lib",
332338
version: "1.1.0",
333-
oldVersion: "1.0.0"
339+
oldVersion: "1.0.0",
340+
dryRun: true
334341
});
335342

336343
files.assert.contents("home/.npmrc",

0 commit comments

Comments
 (0)