From c8aef6d54b16c3a040c5be074d64106ef70febe3 Mon Sep 17 00:00:00 2001 From: Aaron Heesakkers Date: Mon, 14 Sep 2015 14:34:07 +0200 Subject: [PATCH] Add optional singleMachineToTest --- index.js | 5 ++--- mocha-test.js | 3 ++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index 3b961ae..31bea4b 100644 --- a/index.js +++ b/index.js @@ -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 || {}; diff --git a/mocha-test.js b/mocha-test.js index 9cdb930..262b60e 100644 --- a/mocha-test.js +++ b/mocha-test.js @@ -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);