Skip to content

Commit

Permalink
Specify "cron" in error message (#310)
Browse files Browse the repository at this point in the history
* Specify "cron" in error

* Update test per verbiage change
  • Loading branch information
bradymholt authored Nov 16, 2023
1 parent 3eea56c commit 9fe0990
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/cronParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class CronParser {

protected extractParts(expression: string) {
if (!this.expression) {
throw new Error("Expression is empty");
throw new Error("cron expression is empty");
}

// split on one or more spaces
Expand Down
6 changes: 3 additions & 3 deletions test/cronstrue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -702,19 +702,19 @@ describe("Cronstrue", function () {
it("empty expression", function () {
assert.throws(function () {
cronstrue.toString("");
}, "Error: Expression is empty");
}, "Error: cron expression is empty");
});

it("null expression", function () {
assert.throws(function () {
cronstrue.toString(null as any as string);
}, "Error: Expression is empty");
}, "Error: cron expression is empty");
});

it("undefined expression", function () {
assert.throws(function () {
cronstrue.toString("");
}, "Error: Expression is empty");
}, "Error: cron expression is empty");
});

it("'W' list is invalid", function () {
Expand Down

0 comments on commit 9fe0990

Please sign in to comment.