browserstack-cypress-cli 1.36.16 → 1.36.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/helpers/utils.js
CHANGED
|
@@ -495,7 +495,10 @@ exports.setNodeVersion = (bsConfig, args) => {
|
|
|
495
495
|
// command line args takes precedence over config
|
|
496
496
|
exports.setUserSpecs = (bsConfig, args) => {
|
|
497
497
|
if(o11yHelpers.isBrowserstackInfra() && o11yHelpers.isTestObservabilitySession() && o11yHelpers.shouldReRunObservabilityTests()) {
|
|
498
|
-
|
|
498
|
+
// BROWSERSTACK_RERUN_TESTS arrives comma+space separated (e.g. "a.ts, b.ts"); normalise
|
|
499
|
+
// like the other spec sources below, else sanitizeSpecsPattern builds "{a.ts, b.ts}" whose
|
|
500
|
+
// space-prefixed brace alternatives never match and the failed-spec filter collapses.
|
|
501
|
+
bsConfig.run_settings.specs = this.fixCommaSeparatedString(process.env.BROWSERSTACK_RERUN_TESTS);
|
|
499
502
|
return;
|
|
500
503
|
}
|
|
501
504
|
|
|
@@ -881,7 +881,10 @@ const getReRunSpecs = (rawArgs) => {
|
|
|
881
881
|
}
|
|
882
882
|
}
|
|
883
883
|
if(startIdx != -1) rawArgs.splice(startIdx, numEle + 1);
|
|
884
|
-
|
|
884
|
+
// Normalise the comma+space separated rerun list ("a.ts, b.ts") to comma-only before
|
|
885
|
+
// handing it to cypress --spec; a leading space makes cypress miss every spec but the first.
|
|
886
|
+
const reRunSpecs = process.env.BROWSERSTACK_RERUN_TESTS.split(",").map(spec => spec.trim()).filter(Boolean).join(",");
|
|
887
|
+
finalArgs = [...rawArgs, '--spec', reRunSpecs];
|
|
885
888
|
}
|
|
886
889
|
return finalArgs.filter(item => item !== '--disable-test-observability' && item !== '--disable-browserstack-automation');
|
|
887
890
|
}
|