Comparing version 1.0.6 to 1.0.7
@@ -202,2 +202,7 @@ | ||
var self = this; | ||
// Optional 'new' keyword | ||
if (!(this instanceof Cron)) { | ||
return new Cron(pattern); | ||
} | ||
@@ -408,2 +413,3 @@ self.pattern = pattern; | ||
} | ||
}).call(this); |
{ | ||
"name": "croner", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"description": "Isomorphic JavaScript cron parser and scheduler.", | ||
@@ -5,0 +5,0 @@ "author": "Hexagon <github.com/hexagon>", |
@@ -30,2 +30,20 @@ /* | ||
describe('Module', function () { | ||
it('new cron(...) should not throw', function () { | ||
(function(){ | ||
var scheduler = new cron('* * * * * *'), | ||
nextRun = scheduler.next(); | ||
}).should.not.throw(); | ||
}); | ||
it('cron(...) without `new` should not throw', function () { | ||
(function(){ | ||
var scheduler = cron('* * * * * *'), | ||
nextRun = scheduler.next(); | ||
}).should.not.throw(); | ||
}); | ||
}); | ||
describe('Parser', function () { | ||
@@ -32,0 +50,0 @@ |
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
22962
519