claire-mocha

A bridge for using Claire in Mocha

MIT 4 个版本
安装
npm install claire-mocha
yarn add claire-mocha
pnpm add claire-mocha
bun add claire-mocha
README

Claire for Mocha

Claire for Mocha is a library that makes it easier to use the [Claire][] property-based testing library in Mocha.

Example

Just use Claire for Mocha's forAll to define your properties:

global <<< require 'claire-mocha'
global <<< (require 'claire').data
{ for-all } = require 'claire'

describe 'Lists' ->
  o 'Concatenation' -> do
                       for-all (List Int), (List Int)
                       .satisfy (xs, ys) -> (xs.length + ys.length) is (xs ++ ys).length

And run Mocha as you normally would:

$ mocha

  List
    ✓ - Concatenation should yield lists with the same size    

Installation

$ npm install claire-mocha

Licence

MIT/X11. ie.: Do whatever you want.

版本列表
0.2.0 2013-03-10
0.1.2 2013-03-06
0.1.1 2013-02-28
0.1.0 2013-02-28