Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    chocolate-factorypublic

    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

    Keywords

    none

    install

    npm i chocolate-factory

    Downloadslast 7 days

    34

    version

    0.0.3

    license

    none

    repository

    github.com

    last publish

    collaborators

    • avatar