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    
Ask A Question

Questions

How can I use Quickcheck when the function under test is actually a promise?

Posted by Hok Shun Poon about a year ago

I want to test with qc with mocha with forAll, but it doesn't work well with Promise syntax:

it('calling promiseThatReturnsZero should return zero', (done) => {
    qc.forAll(qc.array.subsetOf([1,2,3]), function(someList) {
        promiseThatReturnsZero(someList)
            .done((result) => {
                result.should.be.equal(0);
                done(); // test terminates after first invocation??!?
            });
    });

});

It's a lot of nesting, but you don't get the clarity :/

Loading comments...