Socket
Socket
Sign inDemoInstall

cron

Package Overview
Dependencies
2
Maintainers
2
Versions
66
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.5.0 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();
});
});
SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc