As of now, the tests (./test.js
) and the source are the best documentation. That said, it ain't Rocket Surgery, but it will keep you from pulling cats & herding teeth to configure a test-runner with some hooks so you can cross your I's and dot your T's on your next project. This is just a simple wrapper around Mocha.
Uses globby for file patterns.
npm i @motorman/conductor -D
var { Conductor } = require('@motoman/conductor');
var config = { // see Mocha docs for configs
root: './src',
inclusions: '*/**/*.spec.js', // see @About #globby
};
var conductor = new Conductor(config);
conductor
.subscribe( Conductor.events[x], () => {} ) // see Mocha docs for events
.subscribe( Conductor.events[y], () => {} )
.subscribe( Conductor.events[z], () => {} )
;
conductor.files
.then( (files) => conductor.drive() ) // <-- returns new promise resolution chain
.then( (runner) => runner.addListener( Conductor.events[x], () => {} ) )
;
expect(conductor.files).to.ok;
expect(conductor.subscribe).to.ok;
expect(conductor.drive).to.ok;
expect(conductor.files).to.be.an.instanceof(Promise);
assert.isFunction(conductor.subscribe);
assert.isFunction(conductor.drive);
See @Usage & MochaJS docs.
Where Conductor should start its search for .inclusions
. The .root
serves as the prependix to all patterns of inclusions.
Files to include. May be a glob string or an array of glob strings. See globby for more info.
See MochaJS configurations.
The .files
property is a Promise which encapsulates an array of paths to files which were found by .config.inclusions
.
- @About
- @Configuration docs
- @API docs
.npmignore
?