Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

checkers

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

checkers

Property-based testing for JavaScript via ClojureScript's test.check

  • 0.9.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7
decreased by-46.15%
Maintainers
1
Weekly downloads
 
Created
Source

checkers

Build Status

Property-based testing for JavaScript via ClojureScript's test.check.

test.check is a Clojure property-based testing tool inspired by QuickCheck. The core idea of test.check is that instead of enumerating expected input and output for unit tests, you write properties about your function that should hold true for all inputs. This lets you write concise, powerful tests.

Checkers brings the power of test.check to plain ol' JavaScript.

Install

npm install checkers --save

Usage

var checkers = require('checkers');
var gen = checkers.gen;

// Property is incorrect
checkers.forAll(
    [gen.int],
    function(i) {
        return i * i > i;
    }
).check(1000);

// Property is now correct
checkers.forAll(
    [gen.int],
    function(i) {
        return i * i >= i;
    }
).check(1000);

// Check property with a particular seed
checkers.forAll(
    [gen.int],
    function(i) {
        return i * i >= i;
    }
).check(1000, {seed: 1422111938215});

Documentation

More coming soon!

TODO

  • Generator tests
  • Generator docs
  • Sugar for popular testing frameworks
var checking = require('checkers/mocha'), gen = checking.gen;
checking("property", [gen/int], function ...)
  • Tutorial
  • Better examples

Development

See npm run or package.json for a list of available scripts.

You will need leiningen in order to build locally.

License

Distributed under the Eclipse Public License.

checkers is Copyright © 2015 Glen Mailer and contributors.

test.check is Copyright Rich Hickey, Reid Draper and contributors.

Keywords

FAQs

Package last updated on 25 Jan 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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