Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify "cron" in error message #310

Merged
merged 2 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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