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

jest-date-mock

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jest-date-mock - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

10

lib/index.js

@@ -32,2 +32,10 @@ 'use strict';

// mock Date class
global.window.Date = (0, _mockDate.mockDateClass)(window.Date);
var dateClass = (0, _mockDate.mockDateClass)(Date);
if (global.window) {
// dom env
global.window.Date = dateClass;
} else {
// node / native env
global.Date = dateClass;
}

7

lib/mockDate.js

@@ -25,8 +25,5 @@ 'use strict';

var d = new (Function.prototype.bind.apply(D, [null].concat(_toConsumableArray(p.length === 0 ? [mockNow()] : p))))();
MD.prototype = D.prototype;
return d;
return new (Function.prototype.bind.apply(D, [null].concat(_toConsumableArray(p.length === 0 ? [mockNow()] : p))))();
};
MD.prototype = D.prototype;

@@ -33,0 +30,0 @@ // undefined means do not mock date

{
"name": "jest-date-mock",
"version": "1.0.2",
"version": "1.0.3",
"description": "Mock `window.Date` when run unit test cases with jest. Make tests of `Date` easier.",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

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