jest-mock-now
Advanced tools
Comparing version 1.0.0-alpha.1 to 1.0.0
{ | ||
"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 | ||
``` |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
106968
0
30