Skip to content

Commit

Permalink
Disable HTML reporter in Cucumber.
Browse files Browse the repository at this point in the history
  • Loading branch information
garg3133 committed Feb 15, 2024
1 parent 88df1d8 commit 22d22ba
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/reporter/global-reporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,13 @@ module.exports = class GlobalReporter {
this.suiteResults = [];
this.skippedSuites = 0;
this.uncaughtErr = null;
this.reporterFile = reporter;
this.reportFileName = reportFileName;

if (!Array.isArray(this.reporterFile) && typeof this.reporterFile == 'string') {
this.reporterFile = this.reporterFile.split(',');
this.reporterFile = [];
if (Array.isArray(reporter)) {
this.reporterFile = reporter.slice(0);
} else if (typeof reporter == 'string') {
this.reporterFile = reporter.split(',');
}
this.settings = settings;
this.summary = new Summary(settings);
Expand Down
15 changes: 15 additions & 0 deletions lib/runner/test-runners/cucumber.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,21 @@ class CucumberRunnner extends Runner {
return 'cucumber';
}

constructor(settings, argv, addtOpts) {
super(settings, argv, addtOpts);

// Disable HTML Reporter as it is not yet supported in Cucumber.
// Changing `reporterFile` here shouldn't change the `argv.reporter`
// provided by the user, or `DefaultSettings.default_reporter`.
const reporterFile = this.globalReporter.reporterFile;
if (reporterFile && reporterFile.includes('html')) {
const index = reporterFile.indexOf('html');
if (index > -1) {
reporterFile.splice(index, 1);
}
}
}

hasTestFailures(result) {
return result && result.success === false;
}
Expand Down

0 comments on commit 22d22ba

Please sign in to comment.