gentest icon indicating copy to clipboard operation
gentest copied to clipboard

Expose programmatic API

Open graue opened this issue 11 years ago • 0 comments

In lib/Property.js, there's an interface that could allow people to write their own test runners and use Gentest solely as a library. It implements all the interesting stuff in Gentest in a purely functional way: defining properties with the forAll sugar, generating test cases for a property, running a test case against a property, and shrinking a failing test case (via an iterator, so the process can be stopped or paused at any step).

All that needs to be done is to:

  • [ ] Expose this API publicly.
  • [ ] Provide a way to go from the opaque "test case" type returned by genTest and consumed by runTest (which is, secretly, a tree) to a POJO, for display/logging.
  • [ ] Ideally, document this API somewhere other than in the source.

(Among the benefits: This could provide a basis for adapters to use Gentest within Jasmine/Mocha/QUnit test suites.)

graue avatar Nov 01 '14 08:11 graue