From eeeafc4ec50d938a16e1ec4d0dceea35a8475952 Mon Sep 17 00:00:00 2001 From: juergba Date: Wed, 22 Jan 2020 11:49:36 +0100 Subject: [PATCH] new helper invokeNode --- test/integration/helpers.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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;