chape
v0.2.0
Published
trivial jsverify wrapper for tape
Downloads
6
Maintainers
Readme
chape
This exports a helper method, which can be used to check a jsverify property with with tape.
If tape
is new to you, see http://www.macwright.org/2014/03/11/tape-is-cool.html
for some propaganda.
Usage
npm i --save-dev chape
then
const test = require('tape').test
const jsc = require('jsverify')
const check = require('check')
Simple example, showing something obvious isn't true
const is_not_zero = function (n) { return n !== 0 }
test('all integers are non-zero', function (t) {
check(jsc.forall('integer', is_not_zero), t)
t.end()
})
The TAP output:
TAP version 13
# all integers are non-zero
not ok 1 property does not hold! found counter example: 0
---
operator: fail
at: Test.t.check (./chape/index.js:12:6)
...
1..1
# tests 1
# pass 0
# fail 1
More
YMMV, there isn't much going on here, it's just a trivial helper, check the source.