🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

cron

Package Overview
Dependencies
Maintainers
2
Versions
91
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cron - npm Package Compare versions

Comparing version

to
1.5.1

examples/get_next_runs.js

4

lib/cron.js

@@ -35,3 +35,3 @@ (function(root, factory) {

if (utcOffset) this.utcOffset = utcOffset;
if (typeof utcOffset !== 'undefined') this.utcOffset = utcOffset;

@@ -142,3 +142,3 @@ var that = this;

if (this.utcOffset) {
if (typeof this.utcOffset !== 'undefined') {
date = date.utcOffset(this.utcOffset);

@@ -145,0 +145,0 @@ }

{
"name": "cron",
"description": "Cron jobs for your node",
"version": "1.5.0",
"version": "1.5.1",
"author": "Nick Campbell <nicholas.j.campbell@gmail.com> (http://github.com/ncb000gt)",

@@ -6,0 +6,0 @@ "bugs": {

@@ -5,2 +5,3 @@ var chai = require('chai');

var moment = require('moment-timezone');
var sinon = require('sinon');

@@ -301,2 +302,26 @@ // most eslint errors here are due to side effects. i don't care much about them right now

});
it('should accept 0 as a valid UTC offset', function() {
var clock = sinon.useFakeTimers();
var cronTime = new cron.CronTime('0 11 * * *', null, 0);
var expected = moment().add(11, 'hours').unix();
var actual = cronTime.sendAt().unix();
expect(actual).to.equal(expected);
clock.restore();
});
it('should accept -120 as a valid UTC offset', function() {
var clock = sinon.useFakeTimers();
var cronTime = new cron.CronTime('0 11 * * *', null, -120);
var expected = moment().add(13, 'hours').unix();
var actual = cronTime.sendAt().unix();
expect(actual).to.equal(expected);
clock.restore();
});
});