The quick_check.js Developer Hub

Welcome to the quick_check.js developer hub. You'll find comprehensive guides and documentation to help you start working with quick_check.js as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    

Basic Generators

Generators for some basic types


Generates a random boolean.


Generates a random integer between 0 and 255.

qc.constructor(constructorFn, argGens...)

Generates random objects by calling the constructor constructorFn with random arguments using the generators supplied by argGens

function Animal(type, weight) {
  this.type = type;
  this.weight = weight;

var randomAnimal = qc.constructor(Animal, qc.pick('tiger', 'cow'), qc.natural);
class Animal
  constructor: (@type, @weight) ->
randomAnimal = qc.constructor Animal, qc.pick('tiger', 'cow'), qc.natural
class Animal {
  constructor(public type: string, public weight: number) {}

let randomAnimal: Animal = qc.constructor(Animal, qc.pick('tiger', 'cow'), qc.natural);

qc.fromFunction(function, argGens...)

Generates a random value by calling a function with random arguments.