@wdio/config 8.3.0 → 8.3.2
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.
|
@@ -3,6 +3,7 @@ import type { PathService, ModuleImportService } from '../types.js';
|
|
|
3
3
|
type Spec = string | string[];
|
|
4
4
|
interface TestrunnerOptionsWithParameters extends Omit<Options.Testrunner, 'capabilities'> {
|
|
5
5
|
watch?: boolean;
|
|
6
|
+
coverage?: boolean;
|
|
6
7
|
spec?: string[];
|
|
7
8
|
suite?: string[];
|
|
8
9
|
capabilities?: Capabilities.RemoteCapabilities;
|
|
@@ -14,6 +15,11 @@ interface MergeConfig extends Omit<Partial<TestrunnerOptionsWithParameters>, 'sp
|
|
|
14
15
|
}
|
|
15
16
|
export default class ConfigParser {
|
|
16
17
|
#private;
|
|
18
|
+
/**
|
|
19
|
+
* config options parsed in via CLI arguments and applied before
|
|
20
|
+
* trying to compile config file
|
|
21
|
+
*/
|
|
22
|
+
private _initialConfig;
|
|
17
23
|
private _pathService;
|
|
18
24
|
private _moduleRequireService;
|
|
19
25
|
private _config;
|
|
@@ -23,7 +29,7 @@ export default class ConfigParser {
|
|
|
23
29
|
* config options parsed in via CLI arguments and applied before
|
|
24
30
|
* trying to compile config file
|
|
25
31
|
*/
|
|
26
|
-
|
|
32
|
+
_initialConfig?: Partial<TestrunnerOptionsWithParameters>, _pathService?: PathService, _moduleRequireService?: ModuleImportService);
|
|
27
33
|
/**
|
|
28
34
|
* initializes the config object
|
|
29
35
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigParser.d.ts","sourceRoot":"","sources":["../../src/lib/ConfigParser.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAUlE,OAAO,KAAK,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAInE,KAAK,IAAI,GAAG,MAA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ED_HOOKS, SUPPORTED_FILE_EXTENSIONS, DEFAULT_CONFIGS, NO_NAMED_CONFIG_EXPORT } from '../constants.js';
|
|
8
8
|
const log = logger('@wdio/config:ConfigParser');
|
|
9
9
|
export default class ConfigParser {
|
|
10
|
+
_initialConfig;
|
|
10
11
|
_pathService;
|
|
11
12
|
_moduleRequireService;
|
|
12
13
|
#isInitialised = false;
|
|
@@ -18,7 +19,8 @@ export default class ConfigParser {
|
|
|
18
19
|
* config options parsed in via CLI arguments and applied before
|
|
19
20
|
* trying to compile config file
|
|
20
21
|
*/
|
|
21
|
-
|
|
22
|
+
_initialConfig = {}, _pathService = new FileSystemPathService(), _moduleRequireService = new RequireLibrary()) {
|
|
23
|
+
this._initialConfig = _initialConfig;
|
|
22
24
|
this._pathService = _pathService;
|
|
23
25
|
this._moduleRequireService = _moduleRequireService;
|
|
24
26
|
this.#configFilePath = configFilePath;
|
|
@@ -27,10 +29,10 @@ export default class ConfigParser {
|
|
|
27
29
|
* specs applied as CLI arguments should be relative from CWD
|
|
28
30
|
* rather than relative to the config file
|
|
29
31
|
*/
|
|
30
|
-
if (
|
|
31
|
-
|
|
32
|
+
if (_initialConfig.spec) {
|
|
33
|
+
_initialConfig.spec = makeRelativeToCWD(_initialConfig.spec);
|
|
32
34
|
}
|
|
33
|
-
this.merge(
|
|
35
|
+
this.merge(_initialConfig);
|
|
34
36
|
}
|
|
35
37
|
/**
|
|
36
38
|
* initializes the config object
|
|
@@ -45,6 +47,22 @@ export default class ConfigParser {
|
|
|
45
47
|
await this.addConfigFile(this.#configFilePath);
|
|
46
48
|
}
|
|
47
49
|
this.merge({ ...object });
|
|
50
|
+
/**
|
|
51
|
+
* enable/disable coverage reporting
|
|
52
|
+
*/
|
|
53
|
+
if (Object.keys(this._initialConfig || {}).includes('coverage')) {
|
|
54
|
+
if (this._config.runner === 'browser') {
|
|
55
|
+
this._config.runner = ['browser', {
|
|
56
|
+
coverage: { enabled: this._initialConfig.coverage }
|
|
57
|
+
}];
|
|
58
|
+
}
|
|
59
|
+
else if (Array.isArray(this._config.runner) && this._config.runner[0] === 'browser') {
|
|
60
|
+
this._config.runner[1].coverage = {
|
|
61
|
+
...this._config.runner[1].coverage,
|
|
62
|
+
enabled: this._initialConfig.coverage
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
}
|
|
48
66
|
this.#isInitialised = true;
|
|
49
67
|
}
|
|
50
68
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wdio/config",
|
|
3
|
-
"version": "8.3.
|
|
3
|
+
"version": "8.3.2",
|
|
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",
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"minimatch": "^6.1.4",
|
|
43
43
|
"tsconfig-paths": "^4.1.0"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "5bf1ad9398ce6a4cc810b331944612d105cdc92e"
|
|
46
46
|
}
|