Skip to content

Commit 0e58a1d

Browse files
authored
chore!: Remove support for multi reporter setup (#325)
Feature has been deprecated for a minute.
1 parent 70f4e90 commit 0e58a1d

File tree

1 file changed

+1
-47
lines changed

1 file changed

+1
-47
lines changed

src/cypress-runner.ts

Lines changed: 1 addition & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import {
1212
} from 'sauce-testrunner-utils';
1313
import cypress from 'cypress';
1414
import util from 'util';
15-
import _ from 'lodash';
1615
import { afterRunTestReport } from '@saucelabs/cypress-plugin';
1716
import { createJUnitReport } from '@saucelabs/cypress-junit-plugin';
1817
import { clearTimeout, setTimeout } from 'timers';
@@ -61,45 +60,6 @@ function isFailedRunResult(
6160
);
6261
}
6362

64-
// Configure reporters
65-
function configureReporters(runCfg: RunConfig, opts: any) {
66-
const reporterConfig = {
67-
reporterEnabled: `spec`,
68-
};
69-
70-
// Adding custom reporters
71-
if (runCfg && runCfg.cypress && runCfg.cypress.reporters) {
72-
for (const reporter of runCfg.cypress.reporters) {
73-
const cfgFieldName = [_.camelCase(reporter.name), 'ReporterOptions'].join(
74-
'',
75-
);
76-
reporterConfig.reporterEnabled = `${reporterConfig.reporterEnabled}, ${reporter.name}`;
77-
reporterConfig[cfgFieldName] = reporter.options || {};
78-
}
79-
}
80-
81-
const reporterConfigPath = path.join(
82-
__dirname,
83-
'..',
84-
'sauce-reporter-config.json',
85-
);
86-
87-
// Save reporters config
88-
fs.writeFileSync(reporterConfigPath, JSON.stringify(reporterConfig));
89-
90-
// Cypress only supports a single reporter out of the box, so we need to use
91-
// a plugin to support multiple reporters.
92-
opts.config.reporter = path.join(
93-
__dirname,
94-
'../node_modules/cypress-multi-reporters/lib/MultiReporters.js',
95-
);
96-
opts.config.reporterOptions = {
97-
configFile: reporterConfigPath,
98-
};
99-
100-
return opts;
101-
}
102-
10363
function getSuite(runCfg: RunConfig, suiteName: string) {
10464
const suites = runCfg.suites || [];
10565
const suite = suites.find((testSuite) => testSuite.name === suiteName);
@@ -159,7 +119,7 @@ function getCypressOpts(
159119
? undefined
160120
: runCfg.resultsDir;
161121

162-
let opts: Partial<CypressCommandLine.CypressRunOptions> = {
122+
const opts: Partial<CypressCommandLine.CypressRunOptions> = {
163123
project: path.dirname(cypressCfgFile),
164124
browser: process.env.SAUCE_BROWSER || suite.browser || 'chrome',
165125
configFile: path.basename(cypressCfgFile),
@@ -184,12 +144,6 @@ function getCypressOpts(
184144
opts.key = runCfg.cypress.key;
185145
}
186146

187-
if (runCfg.cypress.reporters && runCfg.cypress.reporters.length > 0) {
188-
opts = configureReporters(runCfg, opts);
189-
console.log(
190-
'Configuring cypress reporters with saucectl is deprecated and will be removed in a future release. Migrate your configuration to your cypress config file.',
191-
);
192-
}
193147
configureWebkitOptions(process.env, opts, suite);
194148

195149
return opts as CypressCommandLine.CypressRunOptions;

0 commit comments

Comments
 (0)