Getting Started

This page will help you get started with quick_check.js. You'll be up and running in a jiffy!

When installing you will need to first install it as an NPM module:

npm install quick_check --save-dev

Then you will need to add it based on your test framework:

Karma

Just add 'node_modules/quick_check/dist/quick-check.js' to your files config item.

module.exports = function(config) {
  config.set({
		files: [
  		'node_modules/quick_check/dist/quick-check.js',
      // ...
    ]
  });
};

Jasmine

Add the library to the page/runner. Than you can run checks using expect(property).forAll(generators...).

QUnit

Simply load it into the test runner. Then you can use assert.forAll(assertion, generators...) to run quick checks.

Mocha

Since Mocha doesn't really have an assertion library, you can simply use the forAll function and use custom assertions within. Here is an example.

Other

For anything else, you can fairly easily write your own integration. Please see The qc function for in-depth information how the basic algorithm works.

Using with TypeScript

quick_check.js ships with a TypeScript declarations file so you can have your tests type checked. If you are using TSD, you can try running

$ tsd link

Otherwise you can import the definitions file manually:

/// <reference path="path/to/quickcheck/dist/quick-check.d.ts" />

The documentation also contains examples written in TypeScript. These frequently contain superfluous type declarations which are provided as an example of the types that quick_check.js exposes. You do not need to declare these types as the compiler infers them unless you are writing your own generators.