chocolate-factory

0.0.3 • Public • Published

chocolate-factory

Repeatedly run a mocha test with varying parameters.

Example

var testAll = require('chocolate-factory'),
    thingsToTest = [{
      description: 'should return bar with argument foo'
      argument: 'foo'
      returnValue: 'bar'
    }];
 
 testAll(thingsToTest).with(function(testDepiction) {
   baz(testDepiction.argument).should.eql(testDepiction.returnValue);
 });

Notes

  • test depictions must have a description parameter
  • test functions must have testDepicition as their first parameter
  • test functions with two parameters will have mocha's done put into the second parameter
  • only the mocha bdd interface is supported

TODO

  • Support something other than bdd interface

Dependencies (1)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i chocolate-factory

    Weekly Downloads

    79

    Version

    0.0.3

    License

    MIT

    Last publish

    Collaborators

    • apechimp