rapid-check
Advanced tools
Comparing version 0.1.0 to 0.2.0
{ | ||
"name": "rapid-check", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"main": "src/index.js", | ||
@@ -11,4 +11,4 @@ "author": "jan.brecka@gmail.com", | ||
"devDependencies": { | ||
"jest": "^20.0.4" | ||
"jest": "^21.2.1" | ||
} | ||
} |
@@ -1,5 +0,11 @@ | ||
# rapid [![CircleCI](https://circleci.com/gh/honzabrecka/rapid/tree/master.svg?style=svg&circle-token=14045240bf5689c38b0a3dcbf478a2f012ab6574)](https://circleci.com/gh/honzabrecka/rapid/tree/master) | ||
# rapid-check [![CircleCI](https://circleci.com/gh/honzabrecka/rapid-check/tree/master.svg?style=svg&circle-token=14045240bf5689c38b0a3dcbf478a2f012ab6574)](https://circleci.com/gh/honzabrecka/rapid-check/tree/master) | ||
Yet another implementation of property based testing framework with support for async properties. | ||
## Installation | ||
```console | ||
npm install rapid-check | ||
``` | ||
## Usage | ||
@@ -6,0 +12,0 @@ |
@@ -19,2 +19,4 @@ const rng = require('./rng') | ||
const timestamp = () => +new Date() | ||
function* sampleG(rng, gen, count = defaultSampleCount) { | ||
@@ -26,3 +28,3 @@ for (let i = 0; i < count; i++) | ||
const sample = (gen, count = defaultSampleCount) => | ||
intoArray(map(([v, _]) => v), sampleG(rng(), gen, count)) | ||
intoArray(map(([v, _]) => v), sampleG(rng(timestamp()), gen, count)) | ||
@@ -63,3 +65,3 @@ function shrinkFailing(tree, prop) { | ||
const forAll = (gen, prop, count = defaultForAllCount) => { | ||
const samples = sampleG(rng(), gen, count) | ||
const samples = sampleG(rng(timestamp()), gen, count) | ||
let sample | ||
@@ -80,3 +82,3 @@ let result | ||
const asyncForAll = async (gen, prop, count = defaultForAllCount) => { | ||
const samples = sampleG(rng(), gen, count) | ||
const samples = sampleG(rng(timestamp()), gen, count) | ||
let sample | ||
@@ -83,0 +85,0 @@ let result |
12441
373
108
11