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 23, 2020
1 parent 77ea689 commit eeeafc4
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/integration/helpers.js
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 eeeafc4

Please sign in to comment.