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.6 to 1.0.7

3

lib/date.js

@@ -11,2 +11,3 @@ "use strict";

// undefined means unmock.
var DEFAULT = undefined;

@@ -22,3 +23,3 @@

var advanceBy = exports.advanceBy = function advanceBy(ms) {
return nowDate += ms || 0;
return nowDate = (nowDate === undefined ? +new Date() : nowDate) + (ms || 0);
};

@@ -25,0 +26,0 @@

@@ -7,3 +7,3 @@ /**

*/
export declare function advanceBy(ms: number): void;
export declare function advanceBy(ms?: number): void;

@@ -16,3 +16,3 @@ /**

*/
export declare function advanceTo(ms?: number | Date): void;
export declare function advanceTo(ms?: number | Date | string): void;

@@ -19,0 +19,0 @@ /**

@@ -42,2 +42,2 @@ 'use strict';

var version = exports.version = '1.0.5';
var version = exports.version = '1.0.7';

@@ -11,2 +11,3 @@ 'use strict';

var mockDateClass = exports.mockDateClass = function mockDateClass(D) {
// if undefined, use real date, or else mock date
var mockNow = function mockNow() {

@@ -13,0 +14,0 @@ return (0, _date.now)() === undefined ? D.now() : (0, _date.now)();

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

@@ -8,3 +8,3 @@ "main": "lib/index.js",

"scripts": {
"test": "jest",
"test": "jest --no-cache",
"build": "babel src --out-dir lib --copy-files && npm run test",

@@ -11,0 +11,0 @@ "coveralls": "cat ./coverage/lcov.info | coveralls"

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