diff --git a/test/integration/helpers.js b/test/integration/helpers.js index 78251c986b..0d65e91e6b 100644 --- a/test/integration/helpers.js +++ b/test/integration/helpers.js @@ -143,6 +143,8 @@ module.exports = { invokeMochaAsync: invokeMochaAsync, + invokeNode: invokeNode, + /** * Resolves the path to a fixture to the full path. */ @@ -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;