Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add optional singleMachineToTest #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,14 @@ var RawMachinepackTestRunner = require('test-machinepack').rawTestRunner;
var root = process.cwd();
var tmproot = path.join(root, 'tmp');


// Customize generic test driver for mocha
module.exports = function mochaDriver(pathToMachinepackDir) {
module.exports = function mochaDriver(pathToMachinepackDir, singleMachineToTest) {

// Use cwd as our path unless overridden by the arg above
pathToMachinepackDir = pathToMachinepackDir || root;

var opts = {};
RawMachinepackTestRunner(pathToMachinepackDir,function beforeRunningAnyTests(_opts, done){
RawMachinepackTestRunner(pathToMachinepackDir, singleMachineToTest, function beforeRunningAnyTests(_opts, done){
// Expose provided options via closure for use throughout this module.
opts = _opts || {};

Expand Down
3 changes: 2 additions & 1 deletion mocha-test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Run tests
// (this file should be invoked with mocha-- see bin/testmachinepack-mocha)
require('./')();
var singleMachineToTest = process.argv[2];
require('./')(null, singleMachineToTest);