1.0.1 • Published 10 years ago
bandage-runner v1.0.1
bandage-runner
A bandage runner API allowing you to create custom test runners.
npm install bandage-runner --save-devUsage
test.js
var runner = require('bandage-runner')
var testHelper = require('./your-test-helper')
var dependencyContainer = require('./your-dependency-container')
var testParams = [testHelper, dependencyContainer]
runner(testParams)test/example.test.js
module.exports = function(should, helper, container) {
should('be awesome', function* (t) {
t.ok(true, 'checked')
}
}package.json
{
"scripts": {
"test": "node test.js"
}
}Features
- Auto-locates tests in the
testdirectory. - Supports naming test files
*.test.js,*.tests.js,test.js, andtests.js. - Supports passing values into tests.
- Supports passing in an alternative array of test files (ignores the default file glob).
API
runner(params, file, endCb)
arguments
[params]: (Array)parameters to pass to exported test function.[files] (Array|String)exact path(s) of file(s) containing tests.[endCb] (Function)function which is called after all tests finish.