quick_check.js

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    

Generator Transformation

🚧

Advanced tutorial

The contents of this document should be considered advanced and is provided mostly for interest. You do not need to understand this document in order to use quick_check.js to its full potential.

qc.map βΈ¬ (a β†’ b) β†’ Gen a β†’ Gen b

This allows you to define a generator in terms of another generator. This function is curried.

qc.of βΈ¬ a β†’ Gen a

Creates a generator based on a constant value. This generator returns the constant value passed into it. In effect, it works like Lodash's _.constant function.

expect(function(a) {
  return a === 5;
}).forAll(qc.of(3));
expect (a) ->
  a == 5
.forAll qc.of 3
expect(a => a === 5).forAll(qc.of(3));

qc.join βΈ¬ Gen (Gen a) β†’ Gen a

Takes a generator generator and returns a generator. This way you can unwrap unnecessarily complex values.

Updated 4 years ago

Generator Transformation


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.