Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Socket
Sign inDemoInstall

node-cron

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-cron - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

src/node-cron.js

4

package.json
{
"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(){

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc