Skip to content

Commit

Permalink
new helper invokeNode
Browse files Browse the repository at this point in the history
  • Loading branch information
juergba committed Jan 22, 2020
1 parent 1c95df1 commit 17068a3
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/integration/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ module.exports = {

invokeMochaAsync: invokeMochaAsync,

invokeNode: invokeNode,

/**
* Resolves the path to a fixture to the full path.
*/
Expand Down Expand Up @@ -227,6 +229,19 @@ function invokeMochaAsync(args, opts) {
return [mochaProcess, resultPromise];
}

/**
* Invokes Node without Mocha binary with the given arguments,
* when Mocha is used programmatically.
*/
function invokeNode(args, fn, opts) {
if (typeof args === 'function') {
opts = fn;
fn = args;
args = [];
}
return _spawnMochaWithListeners(args, fn, opts);
}

function invokeSubMocha(args, fn, opts) {
if (typeof args === 'function') {
opts = fn;
Expand Down

0 comments on commit 17068a3

Please sign in to comment.