Skip to content

Commit

Permalink
paased nightwatch formatter as array
Browse files Browse the repository at this point in the history
  • Loading branch information
harshit-bs committed Jun 26, 2023
1 parent 2d9af0c commit 04a5d7e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/runner/test-runners/cucumber.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,7 @@ class CucumberSuite extends TestSuite {
}

shouldUseNightwatchFormatter(options) {
return ((!options.format &&
!this.argv.format &&
NightwatchEventHub.isAvailable) ||
return (NightwatchEventHub.isAvailable ||
options.format === 'nightwatch-format' ||
this.argv.format === 'nightwatch-format'
);
Expand All @@ -113,7 +111,7 @@ class CucumberSuite extends TestSuite {
}

if (this.shouldUseNightwatchFormatter(options)) {
options.format = path.join(__dirname, '../../../cucumber-js/nightwatch-format.js');
options.format = [...(options.format || []), path.join(__dirname, '../../../cucumber-js/nightwatch-format.js')];
}

const {feature_path = ''} = options;
Expand Down Expand Up @@ -158,7 +156,11 @@ class CucumberSuite extends TestSuite {

const allArgv = {
...options,
...this.argv
...this.argv,
format: [
...(Array.isArray(options.format) ? options.format : (isString(options.format) ? [options.format] : [])),
...(Array.isArray(this.argv.format) ? this.argv.format : (isString(this.argv.format) ? [this.argv.format] : []))
]
};

if ((isDefined(allArgv[argName]) && allArgv[argName] !== '') ||
Expand Down

0 comments on commit 04a5d7e

Please sign in to comment.