Skip to content

Commit 5fe5e0a

Browse files
Added a test for the DEBUG flag
1 parent 59dae4f commit 5fe5e0a

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

test/specs/cli.spec.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,21 @@ describe("bump", () => {
4747
expect(cli.stderr).to.contain(manifest.description);
4848
});
4949

50+
it("should print a more detailed error if DEBUG is set", () => {
51+
files.create("package.json", { version: "" });
52+
53+
let cli = bump("major", { env: { DEBUG: "true" }});
54+
55+
expect(cli).to.have.stdout("");
56+
expect(cli).to.have.exitCode(1);
57+
58+
expect(cli).to.have.stderr.that.matches(
59+
/^Error: Unable to determine the current version number. Checked package.json.\n\s+at \w+/
60+
);
61+
62+
expect(files.json("package.json")).to.deep.equal({ version: "" });
63+
});
64+
5065
describe("bump --help", () => {
5166
it("should show usage text", () => {
5267
let cli = bump("--help");

0 commit comments

Comments
 (0)