Skip to content

ykankaya/fantasy-check

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fantasy Check

Build Status Dependencies Status

General

QuickCheck is a form of automated specification testing. Instead of manually writing tests cases like so:

   assert(0 + 1 == 1);
   assert(1 + 1 == 2);
   assert(3 + 3 == 6);

We can just write the assertion algebraically and tell QuickCheck to automatically generate lots of inputs:

   λ.forAll(
       function(n) {
           return n + n == 2 * n;
       },
       [Number]
   ).fold(
       function(fail) {
           return "Failed after " + fail.tries + " tries: " + fail.inputs.toString();
       },
       "All tests passed!",
   )

Testing

Library

Fantasy Check uses nodeunit for all the tests and because of this there is currently an existing adapter in the library to help with integration between nodeunit and Fantasy Check.

Coverage

Currently Fantasy Check is using Istanbul for code coverage analysis; you can run the coverage via the following command:

This assumes that you have istanbul installed correctly.

istanbul cover nodeunit -- test/*.js

It should report that the total coverage is at 100% for the whole lib.

About

QuickCheck Library using Fantasy-Land

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%