Comparing version 0.0.4 to 0.0.5
{ | ||
"name": "node-cron", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "A simple cron-like task scheduler for Node.js", | ||
@@ -8,3 +8,3 @@ "author": "Lucas Merencia", | ||
"homepage": "https://github.com/merencia/node-cron#readme", | ||
"main": "src/cron.js", | ||
"main": "src/node-cron.js", | ||
"scripts": { | ||
@@ -11,0 +11,0 @@ "test": "mocha -t 20000", |
@@ -5,3 +5,3 @@ 'use strict'; | ||
var sinon = require('sinon'); | ||
var cron = require('../src/cron.js'); | ||
var cron = require('../src/node-cron'); | ||
@@ -8,0 +8,0 @@ describe('scheduling on day', function(){ |
@@ -5,3 +5,3 @@ 'use strict'; | ||
var sinon = require('sinon'); | ||
var cron = require('../src/cron.js'); | ||
var cron = require('../src/node-cron'); | ||
@@ -8,0 +8,0 @@ describe('scheduling on hour', function(){ |
@@ -5,3 +5,3 @@ 'use strict'; | ||
var sinon = require('sinon'); | ||
var cron = require('../src/cron.js'); | ||
var cron = require('../src/node-cron'); | ||
@@ -8,0 +8,0 @@ describe('scheduling on minutes', function(){ |
@@ -5,3 +5,3 @@ 'use strict'; | ||
var sinon = require('sinon'); | ||
var cron = require('../src/cron.js'); | ||
var cron = require('../src/node-cron'); | ||
@@ -8,0 +8,0 @@ describe('scheduling on month', function(){ |
@@ -5,5 +5,5 @@ 'use strict'; | ||
var sinon = require('sinon'); | ||
var cron = require('../src/cron.js'); | ||
var cron = require('../src/node-cron'); | ||
describe('scheduling on minutes', function(){ | ||
describe('scheduling on day of the week', function(){ | ||
beforeEach(function(){ | ||
@@ -40,2 +40,13 @@ this.clock = sinon.useFakeTimers(); | ||
it('should execute a task on mondays passing name', function() { | ||
var initialDate = new Date(2016, 0, 31); | ||
this.clock = sinon.useFakeTimers(initialDate.getTime()); | ||
var executed = 0; | ||
cron.schedule('0 1 * * Monday', function(){ | ||
executed += 1; | ||
}); | ||
this.clock.tick(3000 * 60 * 60 * 24); | ||
expect(executed).to.equal(1); | ||
}); | ||
it('should execute a task on days of the week multiple of 2', function() { | ||
@@ -42,0 +53,0 @@ var initialDate = new Date(2016, 1, 1); |
@@ -5,3 +5,3 @@ 'use strict'; | ||
var sinon = require('sinon'); | ||
var cron = require('../src/cron.js'); | ||
var cron = require('../src/node-cron'); | ||
@@ -8,0 +8,0 @@ describe('scheduling a task with exception', function(){ |
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
17058
16
368