@wdio/config 9.23.0 → 9.23.1

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.
@@ -1 +1 @@
1
- {"version":3,"file":"ConfigParser.d.ts","sourceRoot":"","sources":["../../src/node/ConfigParser.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAa,QAAQ,EAAE,MAAM,aAAa,CAAA;AAO7E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAM9C,KAAK,IAAI,GAAG,MAAM,GAAG,MAAM,EAAE,CAAA;AAK7B,UAAU,+BAAgC,SAAQ,OAAO,CAAC,UAAU;IAChE,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;IAChB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,YAAY,CAAC,EAAE,YAAY,CAAC,sBAAsB,CAAA;IAClD,OAAO,EAAE,MAAM,CAAA;IACf,YAAY,CAAC,EAAE,MAAM,CAAA;CACxB;AAED,UAAU,WAAY,SAAQ,IAAI,CAAC,OAAO,CAAC,+BAA+B,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC7F,KAAK,CAAC,EAAE,IAAI,EAAE,CAAA;IACd,YAAY,CAAC,EAAE,IAAI,EAAE,CAAA;IACrB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAClB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;IACzB,KAAK,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,MAAM,CAAC,OAAO,OAAO,YAAY;;IAQzB;;;OAGG;IACH,OAAO,CAAC,cAAc;IACtB,OAAO,CAAC,YAAY;IAVxB,OAAO,CAAC,OAAO,CAAiC;IAChD,OAAO,CAAC,aAAa,CAAC,CAA0C;gBAG5D,c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AU,CAAC,EAAE,IAAI,EAAE;IAgF/C;;;;;;;;OAQG;IACH,0BAA0B,CAAC,cAAc,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,KAAK,CAAC,EAAE,OAAO;IAgDnF;;OAEG;IACH,SAAS,IAIkB,QAAQ,CAAC,WAAW,CAAC,MAAM,CAAC;IAGvD;;OAEG;IACH,eAAe,CAAC,CAAC,CAAC,EAAE,MAAM,GAAG,YAAY,CAAC,sBAAsB,GAAG,YAAY,CAAC,+BAA+B;IAY/G;;;;;;;;OAQG;IACH,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,GAAE,WAAyC,EAAE,cAAc,CAAC,EAAE,MAAM;IAkDtI;;;;;;OAMG;IACH,WAAW,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE;IA2BhD,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE;CAWtB"}
@@ -377,7 +377,17 @@ var ConfigParser = class _ConfigParser {
377
377
  const isSpecParamPassed = Array.isArray(this._config.spec) && this._config.spec.length > 0;
378
378
  const repeat = this._config.repeat;
379
379
  let specs = _ConfigParser.getFilePaths(this._config.specs, this._config.rootDir, this._pathService);
380
- let exclude = allKeywordsContainPath(this._config.exclude) ? _ConfigParser.getFilePaths(this._config.exclude, this._config.rootDir, this._pathService) : this._config.exclude || [];
380
+ const configSuiteNames = Object.keys(this._config.suites || {});
381
+ const excludeSuites = [];
382
+ const excludeSpecPatterns = [];
383
+ for (const item of this._config.exclude || []) {
384
+ if (!isSpecPattern(item) && configSuiteNames.includes(item)) {
385
+ excludeSuites.push(item);
386
+ } else {
387
+ excludeSpecPatterns.push(item);
388
+ }
389
+ }
390
+ let exclude = allKeywordsContainPath(excludeSpecPatterns) ? _ConfigParser.getFilePaths(excludeSpecPatterns, this._config.rootDir, this._pathService) : excludeSpecPatterns;
381
391
  const suites = Array.isArray(this._config.suite) ? this._config.suite : [];
382
392
  if (Array.isArray(capExclude)) {
383
393
  exclude = [...exclude, ..._ConfigParser.getFilePaths(capExclude, this._config.rootDir, this._pathService)];
@@ -388,6 +398,10 @@ var ConfigParser = class _ConfigParser {
388
398
  if (suites.length > 0) {
389
399
  let suiteSpecs = [];
390
400
  for (const suiteName of suites) {
401
+ if (excludeSuites.includes(suiteName)) {
402
+ log.info(`Suite "${suiteName}" excluded via --exclude`);
403
+ continue;
404
+ }
391
405
  const suite = this._config.suites?.[suiteName];
392
406
  if (!suite) {
393
407
  log.warn(`No suite was found with name "${suiteName}"`);
@@ -396,8 +410,9 @@ var ConfigParser = class _ConfigParser {
396
410
  suiteSpecs = suiteSpecs.concat(_ConfigParser.getFilePaths(suite, this._config.rootDir, this._pathService));
397
411
  }
398
412
  }
399
- if (suiteSpecs.length === 0) {
400
- throw new Error(`The suite(s) "${suites.join('", "')}" you specified don't exist in your config file or doesn't contain any files!`);
413
+ const nonExcludedSuites = suites.filter((s) => !excludeSuites.includes(s));
414
+ if (suiteSpecs.length === 0 && nonExcludedSuites.length > 0) {
415
+ throw new Error(`The suite(s) "${nonExcludedSuites.join('", "')}" you specified don't exist in your config file or doesn't contain any files!`);
401
416
  }
402
417
  specs = isSpecParamPassed ? [...specs, ...suiteSpecs] : suiteSpecs;
403
418
  }
@@ -578,6 +593,15 @@ var ConfigParser = class _ConfigParser {
578
593
  function allKeywordsContainPath(excludedSpecList) {
579
594
  return excludedSpecList.every((val) => val.includes("/") || val.includes("\\") || val.includes("*"));
580
595
  }
596
+ function isSpecPattern(str) {
597
+ if (/[/\\*?]/.test(str)) {
598
+ return true;
599
+ }
600
+ if (/\.(js|ts|mjs|cjs|es6|feature)$/i.test(str)) {
601
+ return true;
602
+ }
603
+ return false;
604
+ }
581
605
  function filterEmptyArrayItems(specList) {
582
606
  return specList.filter((item) => Array.isArray(item) && item.length || !Array.isArray(item));
583
607
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wdio/config",
3
- "version": "9.23.0",
3
+ "version": "9.23.1",
4
4
  "description": "A helper utility to parse and validate WebdriverIO options",
5
5
  "author": "Christian Bromann <mail@bromann.dev>",
6
6
  "homepage": "https://github.com/webdriverio/webdriverio/tree/main/packages/wdio-config",
@@ -37,8 +37,8 @@
37
37
  },
38
38
  "dependencies": {
39
39
  "@wdio/logger": "9.18.0",
40
- "@wdio/types": "9.20.0",
41
- "@wdio/utils": "9.23.0",
40
+ "@wdio/types": "9.23.1",
41
+ "@wdio/utils": "9.23.1",
42
42
  "deepmerge-ts": "^7.0.3",
43
43
  "glob": "^10.2.2",
44
44
  "import-meta-resolve": "^4.0.0"
@@ -49,5 +49,5 @@
49
49
  "devDependencies": {
50
50
  "minimatch": "^9.0.0"
51
51
  },
52
- "gitHead": "5b35e4e2b94e3ac5247ec2bf27f2f5e41ef00372"
52
+ "gitHead": "19ac2c1dd86f3bdd967bc6c22c5bcdd78907b988"
53
53
  }