cron-parser
Advanced tools
Comparing version 0.3.3 to 0.3.4
@@ -114,3 +114,4 @@ 'use strict'; | ||
value = value.replace(/^[a-z]{1,3}$/gi, function(match) { | ||
value = value.replace(/[a-z]{1,3}/gi, function(match) { | ||
match = match.toLowerCase(); | ||
if (aliases[match]) { | ||
@@ -117,0 +118,0 @@ return aliases[match]; |
{ | ||
"name": "cron-parser", | ||
"version": "0.3.3", | ||
"version": "0.3.4", | ||
"description": "Node.js library for parsing crontab instructions", | ||
@@ -5,0 +5,0 @@ "main": "lib/parser.js", |
@@ -320,1 +320,48 @@ var util = require('util'); | ||
test('expression using days of week strings', function(t) { | ||
CronExpression.parse('15 10 * * MON-TUE', function(err, interval) { | ||
t.ifError(err, 'Interval parse error'); | ||
t.ok(interval, 'Interval parsed'); | ||
var intervals = interval.iterate(8); | ||
t.ok(intervals, 'Found intervals'); | ||
for (var i = 0, c = intervals.length; i < c; i++) { | ||
var next = intervals[i]; | ||
var day = next.getDay(); | ||
t.ok(next, 'Found next scheduled interval'); | ||
t.ok(day == 1 || day == 2, "Day matches") | ||
t.equal(next.getHours(), 10, 'Hour matches'); | ||
t.equal(next.getMinutes(), 15, 'Minute matches'); | ||
} | ||
t.end(); | ||
}); | ||
}); | ||
test('expression using mixed days of week strings', function(t) { | ||
CronExpression.parse('15 10 * jAn-FeB mOn-tUE', function(err, interval) { | ||
t.ifError(err, 'Interval parse error'); | ||
t.ok(interval, 'Interval parsed'); | ||
var intervals = interval.iterate(8); | ||
t.ok(intervals, 'Found intervals'); | ||
for (var i = 0, c = intervals.length; i < c; i++) { | ||
var next = intervals[i]; | ||
var day = next.getDay(); | ||
var month = next.getMonth(); | ||
t.ok(next, 'Found next scheduled interval'); | ||
t.ok(month == 0 || month == 2, "Month Matches"); | ||
t.ok(day == 1 || day == 2, "Day matches"); | ||
t.equal(next.getHours(), 10, 'Hour matches'); | ||
t.equal(next.getMinutes(), 15, 'Minute matches'); | ||
} | ||
t.end(); | ||
}); | ||
}); | ||
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
60325
966