@wdio/config 9.0.0-alpha.115 → 9.0.0-alpha.321
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/build/constants.d.ts +1 -1
- package/build/constants.d.ts.map +1 -1
- package/build/constants.js +0 -7
- package/build/node/ConfigParser.d.ts +7 -7
- package/build/node/ConfigParser.d.ts.map +1 -1
- package/build/node/ConfigParser.js +8 -15
- package/build/node/utils.d.ts +1 -5
- package/build/node/utils.d.ts.map +1 -1
- package/build/node/utils.js +6 -30
- package/package.json +6 -6
package/build/constants.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Options, Services } from '@wdio/types';
|
|
2
|
-
export declare const DEFAULT_CONFIGS: () =>
|
|
2
|
+
export declare const DEFAULT_CONFIGS: () => Options.Testrunner;
|
|
3
3
|
export declare const SUPPORTED_HOOKS: (keyof Services.Hooks)[];
|
|
4
4
|
export declare const SUPPORTED_FILE_EXTENSIONS: string[];
|
|
5
5
|
export declare const NO_NAMED_CONFIG_EXPORT: string;
|
package/build/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAKpD,eAAO,MAAM,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAKpD,eAAO,MAAM,eAAe,EAAE,MAAM,OAAO,CAAC,UAgF1C,CAAA;AAEF,eAAO,MAAM,eAAe,EAAE,CAAC,MAAM,QAAQ,CAAC,KAAK,CAAC,EAOnD,CAAA;AAED,eAAO,MAAM,yBAAyB,UAErC,CAAA;AAED,eAAO,MAAM,sBAAsB,QAIlC,CAAA"}
|
package/build/constants.js
CHANGED
|
@@ -34,13 +34,6 @@ export const DEFAULT_CONFIGS = () => ({
|
|
|
34
34
|
reporterSyncInterval: 100,
|
|
35
35
|
reporterSyncTimeout: 5000,
|
|
36
36
|
cucumberFeaturesWithLineNumbers: [],
|
|
37
|
-
autoCompileOpts: {
|
|
38
|
-
autoCompile: true,
|
|
39
|
-
tsNodeOpts: {
|
|
40
|
-
transpileOnly: true
|
|
41
|
-
},
|
|
42
|
-
babelOpts: {}
|
|
43
|
-
},
|
|
44
37
|
/**
|
|
45
38
|
* framework defaults
|
|
46
39
|
*/
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import type { Capabilities, Options, Services } from '@wdio/types';
|
|
2
|
-
import type { PathService
|
|
2
|
+
import type { PathService } from '../types.js';
|
|
3
3
|
type Spec = string | string[];
|
|
4
|
-
interface TestrunnerOptionsWithParameters extends
|
|
4
|
+
interface TestrunnerOptionsWithParameters extends Options.Testrunner {
|
|
5
5
|
watch?: boolean;
|
|
6
6
|
coverage?: boolean;
|
|
7
7
|
spec?: string[];
|
|
8
8
|
suite?: string[];
|
|
9
9
|
repeat?: number;
|
|
10
|
-
capabilities?: Capabilities.
|
|
10
|
+
capabilities?: Capabilities.TestrunnerCapabilities;
|
|
11
11
|
rootDir: string;
|
|
12
|
+
tsConfigPath?: string;
|
|
12
13
|
}
|
|
13
14
|
interface MergeConfig extends Omit<Partial<TestrunnerOptionsWithParameters>, 'specs' | 'exclude'> {
|
|
14
15
|
specs?: Spec[];
|
|
@@ -24,15 +25,14 @@ export default class ConfigParser {
|
|
|
24
25
|
*/
|
|
25
26
|
private _initialConfig;
|
|
26
27
|
private _pathService;
|
|
27
|
-
private _moduleRequireService;
|
|
28
28
|
private _config;
|
|
29
|
-
private _capabilities
|
|
29
|
+
private _capabilities?;
|
|
30
30
|
constructor(configFilePath: string,
|
|
31
31
|
/**
|
|
32
32
|
* config options parsed in via CLI arguments and applied before
|
|
33
33
|
* trying to compile config file
|
|
34
34
|
*/
|
|
35
|
-
_initialConfig?: Partial<TestrunnerOptionsWithParameters>, _pathService?: PathService
|
|
35
|
+
_initialConfig?: Partial<TestrunnerOptionsWithParameters>, _pathService?: PathService);
|
|
36
36
|
/**
|
|
37
37
|
* initializes the config object
|
|
38
38
|
*/
|
|
@@ -75,7 +75,7 @@ export default class ConfigParser {
|
|
|
75
75
|
/**
|
|
76
76
|
* return capabilities
|
|
77
77
|
*/
|
|
78
|
-
getCapabilities(i?: number): Capabilities.
|
|
78
|
+
getCapabilities(i?: number): Capabilities.TestrunnerCapabilities | Capabilities.RequestedStandaloneCapabilities | undefined;
|
|
79
79
|
/**
|
|
80
80
|
* returns a flattened list of globbed files
|
|
81
81
|
*
|
|
@@ -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;
|
|
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,OA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DtI;;;;;;OAMG;IACH,WAAW,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE;IAyBhD,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE;CAWtB"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
2
|
import logger from '@wdio/logger';
|
|
3
3
|
import { deepmerge, deepmergeCustom } from 'deepmerge-ts';
|
|
4
|
-
import RequireLibrary from './RequireLibrary.js';
|
|
5
4
|
import FileSystemPathService from './FileSystemPathService.js';
|
|
6
|
-
import { makeRelativeToCWD,
|
|
5
|
+
import { makeRelativeToCWD, loadTypeScriptCompiler } from './utils.js';
|
|
7
6
|
import { removeLineNumbers, isCucumberFeatureWithLineNumber, validObjectOrArray } from '../utils.js';
|
|
8
7
|
import { SUPPORTED_HOOKS, SUPPORTED_FILE_EXTENSIONS, DEFAULT_CONFIGS, NO_NAMED_CONFIG_EXPORT } from '../constants.js';
|
|
9
8
|
const log = logger('@wdio/config:ConfigParser');
|
|
@@ -11,7 +10,6 @@ const MERGE_DUPLICATION = ['services', 'reporters'];
|
|
|
11
10
|
export default class ConfigParser {
|
|
12
11
|
_initialConfig;
|
|
13
12
|
_pathService;
|
|
14
|
-
_moduleRequireService;
|
|
15
13
|
#isInitialised = false;
|
|
16
14
|
#configFilePath;
|
|
17
15
|
_config;
|
|
@@ -21,10 +19,9 @@ export default class ConfigParser {
|
|
|
21
19
|
* config options parsed in via CLI arguments and applied before
|
|
22
20
|
* trying to compile config file
|
|
23
21
|
*/
|
|
24
|
-
_initialConfig = {}, _pathService = new FileSystemPathService()
|
|
22
|
+
_initialConfig = {}, _pathService = new FileSystemPathService()) {
|
|
25
23
|
this._initialConfig = _initialConfig;
|
|
26
24
|
this._pathService = _pathService;
|
|
27
|
-
this._moduleRequireService = _moduleRequireService;
|
|
28
25
|
this.#configFilePath = configFilePath;
|
|
29
26
|
this._config = Object.assign({ rootDir: path.dirname(configFilePath) }, DEFAULT_CONFIGS());
|
|
30
27
|
/**
|
|
@@ -34,14 +31,6 @@ export default class ConfigParser {
|
|
|
34
31
|
if (_initialConfig.spec) {
|
|
35
32
|
_initialConfig.spec = makeRelativeToCWD(_initialConfig.spec);
|
|
36
33
|
}
|
|
37
|
-
/**
|
|
38
|
-
* the autoCompileOpts.autoCompile CLI argument has to be converted
|
|
39
|
-
* from type string to type boolean
|
|
40
|
-
*/
|
|
41
|
-
if (typeof _initialConfig.autoCompileOpts?.autoCompile === 'string') {
|
|
42
|
-
const strValue = _initialConfig.autoCompileOpts.autoCompile;
|
|
43
|
-
_initialConfig.autoCompileOpts.autoCompile = !!strValue && strValue !== 'false';
|
|
44
|
-
}
|
|
45
34
|
this.merge(_initialConfig, false);
|
|
46
35
|
}
|
|
47
36
|
/**
|
|
@@ -53,7 +42,7 @@ export default class ConfigParser {
|
|
|
53
42
|
* multiple times, e.g. when used with the packages/wdio-cli/src/watcher.ts
|
|
54
43
|
*/
|
|
55
44
|
if (!this.#isInitialised) {
|
|
56
|
-
await
|
|
45
|
+
await loadTypeScriptCompiler(this._config.tsConfigPath);
|
|
57
46
|
await this.addConfigFile(this.#configFilePath);
|
|
58
47
|
}
|
|
59
48
|
this.merge({ ...object });
|
|
@@ -97,6 +86,10 @@ export default class ConfigParser {
|
|
|
97
86
|
if (typeof config !== 'object') {
|
|
98
87
|
throw new Error(NO_NAMED_CONFIG_EXPORT);
|
|
99
88
|
}
|
|
89
|
+
const configFileCapabilities = config.capabilities;
|
|
90
|
+
if (!configFileCapabilities) {
|
|
91
|
+
throw new Error(`No \`capabilities\` property found in WebdriverIO.Config defined in file: ${filePath}`);
|
|
92
|
+
}
|
|
100
93
|
/**
|
|
101
94
|
* clone the original config
|
|
102
95
|
*/
|
|
@@ -104,7 +97,7 @@ export default class ConfigParser {
|
|
|
104
97
|
/**
|
|
105
98
|
* merge capabilities
|
|
106
99
|
*/
|
|
107
|
-
const defaultTo = Array.isArray(this._capabilities) ? [] : {};
|
|
100
|
+
const defaultTo = (Array.isArray(this._capabilities) ? [] : {});
|
|
108
101
|
this._capabilities = deepmerge(this._capabilities, fileConfig.capabilities || defaultTo);
|
|
109
102
|
delete fileConfig.capabilities;
|
|
110
103
|
/**
|
package/build/node/utils.d.ts
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
import type { ModuleImportService } from '../types.js';
|
|
3
|
-
export declare function loadTypeScriptCompiler(autoCompileConfig: Options.AutoCompileConfig): Promise<boolean>;
|
|
1
|
+
export declare function loadTypeScriptCompiler(tsConfigPath?: string): Promise<boolean>;
|
|
4
2
|
export declare function makeRelativeToCWD(files?: (string | string[])[]): (string | string[])[];
|
|
5
|
-
export declare function loadAutoCompilers(autoCompileConfig: Options.AutoCompileConfig, requireService: ModuleImportService): Promise<boolean | undefined>;
|
|
6
|
-
export declare function loadBabelCompiler(babelOpts: Record<string, any> | undefined, requireService: ModuleImportService): Promise<boolean>;
|
|
7
3
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/node/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/node/utils.ts"],"names":[],"mappings":"AAYA,wBAAsB,sBAAsB,CAAE,YAAY,CAAC,EAAE,MAAM,oBAwBlE;AAED,wBAAgB,iBAAiB,CAAE,KAAK,GAAE,CAAC,MAAM,GAAG,MAAM,EAAE,CAAC,EAAO,GAAG,CAAC,MAAM,GAAG,MAAM,EAAE,CAAC,EAAE,CAkB3F"}
|
package/build/node/utils.js
CHANGED
|
@@ -5,7 +5,7 @@ import { resolve } from 'import-meta-resolve';
|
|
|
5
5
|
import logger from '@wdio/logger';
|
|
6
6
|
import { objectToEnv } from '../utils.js';
|
|
7
7
|
const log = logger('@wdio/config:utils');
|
|
8
|
-
export async function loadTypeScriptCompiler(
|
|
8
|
+
export async function loadTypeScriptCompiler(tsConfigPath) {
|
|
9
9
|
/**
|
|
10
10
|
* don't auto compile within worker as it already was spawn with a loader
|
|
11
11
|
*/
|
|
@@ -16,18 +16,17 @@ export async function loadTypeScriptCompiler(autoCompileConfig) {
|
|
|
16
16
|
/**
|
|
17
17
|
* only for testing purposes
|
|
18
18
|
*/
|
|
19
|
-
if (process.env.VITEST_WORKER_ID && process.env.
|
|
19
|
+
if (process.env.VITEST_WORKER_ID && process.env.THROW_TSX_RESOLVE) {
|
|
20
20
|
throw new Error('test fail');
|
|
21
21
|
}
|
|
22
|
-
await resolve('
|
|
23
|
-
const loaderPath = await resolve('ts-node/esm/transpile-only.mjs', import.meta.url);
|
|
22
|
+
const loaderPath = await resolve('tsx', import.meta.url);
|
|
24
23
|
await access(new URL(loaderPath));
|
|
25
|
-
process.env.
|
|
26
|
-
objectToEnv(
|
|
24
|
+
process.env.WDIO_LOAD_TSX = '1';
|
|
25
|
+
objectToEnv({ tsConfigPath });
|
|
27
26
|
return true;
|
|
28
27
|
}
|
|
29
28
|
catch (err) {
|
|
30
|
-
log.debug(`Failed loading
|
|
29
|
+
log.debug(`Failed loading TSX: ${err.message}`);
|
|
31
30
|
return false;
|
|
32
31
|
}
|
|
33
32
|
}
|
|
@@ -46,26 +45,3 @@ export function makeRelativeToCWD(files = []) {
|
|
|
46
45
|
}
|
|
47
46
|
return returnFiles;
|
|
48
47
|
}
|
|
49
|
-
export async function loadAutoCompilers(autoCompileConfig, requireService) {
|
|
50
|
-
if (!autoCompileConfig.autoCompile) {
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
return (await loadTypeScriptCompiler(autoCompileConfig) ||
|
|
54
|
-
await loadBabelCompiler(autoCompileConfig.babelOpts, requireService));
|
|
55
|
-
}
|
|
56
|
-
export async function loadBabelCompiler(babelOpts = {}, requireService) {
|
|
57
|
-
try {
|
|
58
|
-
/**
|
|
59
|
-
* only for testing purposes
|
|
60
|
-
*/
|
|
61
|
-
if (process.env.VITEST_WORKER_ID && process.env.THROW_BABEL_REGISTER) {
|
|
62
|
-
throw new Error('test fail');
|
|
63
|
-
}
|
|
64
|
-
(await requireService.import('@babel/register'))(babelOpts);
|
|
65
|
-
log.debug('Found \'@babel/register\' package, auto-compiling files with Babel');
|
|
66
|
-
return true;
|
|
67
|
-
}
|
|
68
|
-
catch (err) {
|
|
69
|
-
return false;
|
|
70
|
-
}
|
|
71
|
-
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wdio/config",
|
|
3
|
-
"version": "9.0.0-alpha.
|
|
3
|
+
"version": "9.0.0-alpha.321+63953a607",
|
|
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",
|
|
@@ -36,11 +36,11 @@
|
|
|
36
36
|
"url": "https://github.com/webdriverio/webdriverio/issues"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@wdio/logger": "9.0.0-alpha.
|
|
40
|
-
"@wdio/types": "9.0.0-alpha.
|
|
41
|
-
"@wdio/utils": "9.0.0-alpha.
|
|
39
|
+
"@wdio/logger": "9.0.0-alpha.321+63953a607",
|
|
40
|
+
"@wdio/types": "9.0.0-alpha.321+63953a607",
|
|
41
|
+
"@wdio/utils": "9.0.0-alpha.321+63953a607",
|
|
42
42
|
"decamelize": "^6.0.0",
|
|
43
|
-
"deepmerge-ts": "^
|
|
43
|
+
"deepmerge-ts": "^7.0.3",
|
|
44
44
|
"glob": "^10.2.2",
|
|
45
45
|
"import-meta-resolve": "^4.0.0"
|
|
46
46
|
},
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"minimatch": "^9.0.0"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "63953a6079023cb390a113fe5ce1c1b01b8e4bb6"
|
|
54
54
|
}
|