Jump to Content
quick_check.jsChangelogGuidesQ&A
HomeGuidesChangelogQ&A
ChangelogGuidesQ&ALog Inquick_check.js
Log In

Q&A

Ask a Question
ANSWERED

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

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 :/
Posted by Hok Shun Poon about 7 years ago
  • Recent
  • Popular
  • Unanswered