New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

jest-mock-now

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jest-mock-now - npm Package Compare versions

Comparing version 1.0.0-alpha.1 to 1.0.0

2

package.json
{
"name": "jest-mock-now",
"version": "1.0.0-alpha.1",
"version": "1.0.0",
"description": "Date.now() as deterministic Jest mock function.",

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

@@ -5,2 +5,4 @@ # jest-mock-now

## Install
```bash

@@ -10,2 +12,6 @@ ➜ ~ yarn add jest-mock-now -D

## Usage
It is possible to use the following configurations at every setup level; in a `setupJest.js` file as well as in a `beforeEach` or a `test` function as shown [here](__tests__/index.test.js).
```javascript

@@ -16,1 +22,11 @@ require('jest-mock-now')();

```
or
```javascript
const now = new Date('2017-06-22');
require('jest-mock-now')(now);
console.log(Date.now()); // 1498089600000
```
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