From 609cd58432c759bc0934cc188974425cfa4b20bf Mon Sep 17 00:00:00 2001 From: Mike Han <56001373+mhan83@users.noreply.github.com> Date: Thu, 18 Jul 2024 10:25:26 -0600 Subject: [PATCH] feat: Opt in only for multi reporter configuration (#300) * Only configure multi reporters if required * Add a warning to move reporter config * fmt * Update src/cypress-runner.ts Co-authored-by: Alex Plischke * Check reporters length * Not just multiple reporter configs that are deprecated * Be specific that its cypress reporters --------- Co-authored-by: Alex Plischke --- src/cypress-runner.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/cypress-runner.ts b/src/cypress-runner.ts index 0272f0f3..baf70fe8 100644 --- a/src/cypress-runner.ts +++ b/src/cypress-runner.ts @@ -183,7 +183,12 @@ function getCypressOpts( opts.key = runCfg.cypress.key; } - opts = configureReporters(runCfg, opts); + if (runCfg.cypress.reporters && runCfg.cypress.reporters.length > 0) { + opts = configureReporters(runCfg, opts); + console.log( + 'Configuring cypress reporters with saucectl is deprecated and will be removed in a future release. Migrate your configuration to your cypress config file.', + ); + } configureWebkitOptions(process.env, opts, suite); return opts as CypressCommandLine.CypressRunOptions;