Skip to content

Commit 6f0062f

Browse files
authored
fix(cli): no error of failed tests when using retry with scenario only (#4020)
1 parent 46e2ba9 commit 6f0062f

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

lib/interfaces/scenarioConfig.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ class ScenarioConfig {
3535
* @returns {this}
3636
*/
3737
retry(retries) {
38+
if (process.env.SCENARIO_ONLY) retries = -retries;
3839
this.test.retries(retries);
3940
return this;
4041
}

lib/ui.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ module.exports = function (suite) {
168168
context.Scenario.only = function (title, opts, fn) {
169169
const reString = `^${escapeRe(`${suites[0].title}: ${title}`.replace(/( \| {.+})?$/g, ''))}`;
170170
mocha.grep(new RegExp(reString));
171+
process.env.SCENARIO_ONLY = true;
171172
return addScenario(title, opts, fn);
172173
};
173174

0 commit comments

Comments
 (0)