@wdio/config 8.0.0-alpha.331 → 8.0.0-alpha.411
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
CHANGED
|
@@ -2,4 +2,5 @@ import type { Options, Services } from '@wdio/types';
|
|
|
2
2
|
export declare const DEFAULT_CONFIGS: () => Omit<Options.Testrunner, 'capabilities'>;
|
|
3
3
|
export declare const SUPPORTED_HOOKS: (keyof Services.Hooks)[];
|
|
4
4
|
export declare const SUPPORTED_FILE_EXTENSIONS: string[];
|
|
5
|
+
export declare const NO_NAMED_CONFIG_EXPORT: string;
|
|
5
6
|
//# sourceMappingURL=constants.d.ts.map
|
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;AAMpD,eAAO,MAAM,eAAe,EAAE,MAAM,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,cAAc,CAgFzE,CAAA;AAEF,eAAO,MAAM,eAAe,EAAE,CAAC,MAAM,QAAQ,CAAC,KAAK,CAAC,EAMnD,CAAA;AAED,eAAO,MAAM,yBAAyB,UAErC,CAAA"}
|
|
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;AAMpD,eAAO,MAAM,eAAe,EAAE,MAAM,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,cAAc,CAgFzE,CAAA;AAEF,eAAO,MAAM,eAAe,EAAE,CAAC,MAAM,QAAQ,CAAC,KAAK,CAAC,EAMnD,CAAA;AAED,eAAO,MAAM,yBAAyB,UAErC,CAAA;AAED,eAAO,MAAM,sBAAsB,QAIlC,CAAA"}
|
package/build/constants.js
CHANGED
|
@@ -88,3 +88,6 @@ export const SUPPORTED_HOOKS = [
|
|
|
88
88
|
export const SUPPORTED_FILE_EXTENSIONS = [
|
|
89
89
|
'.js', '.mjs', '.es6', '.ts', '.feature', '.coffee', '.cjs'
|
|
90
90
|
];
|
|
91
|
+
export const NO_NAMED_CONFIG_EXPORT = ('No named export object called "config" found. Make sure you export the config object ' +
|
|
92
|
+
'via `exports.config = { ... }` when using CommonJS or `export config = { ... }` when ' +
|
|
93
|
+
'using ESM. Read more on this on https://webdriver.io/docs/configurationfile !');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigParser.d.ts","sourceRoot":"","sources":["../../src/lib/ConfigParser.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAUlE,OAAO,KAAK,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAKhE,aAAK,IAAI,GAAG,MAAM,GAAG,MAAM,EAAE,CAAA;
|
|
1
|
+
{"version":3,"file":"ConfigParser.d.ts","sourceRoot":"","sources":["../../src/lib/ConfigParser.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAUlE,OAAO,KAAK,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAKhE,aAAK,IAAI,GAAG,MAAM,GAAG,MAAM,EAAE,CAAA;AAK7B,UAAU,+BAAgC,SAAQ,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,cAAc,CAAC;IACtF,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;IAChB,YAAY,CAAC,EAAE,YAAY,CAAC,kBAAkB,CAAA;CACjD;AAED,UAAU,WAAY,SAAQ,IAAI,CAAC,OAAO,CAAC,+BAA+B,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC7F,KAAK,CAAC,EAAE,IAAI,EAAE,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;CACrB;AAED,MAAM,CAAC,OAAO,OAAO,YAAY;IAKzB,OAAO,CAAC,YAAY;IACpB,OAAO,CAAC,qBAAqB;IALjC,OAAO,CAAC,OAAO,CAAqD;IACpE,OAAO,CAAC,aAAa,CAAsC;gBAG/C,YAAY,GAAE,WAAyC,EACvD,qBAAqB,GAAE,mBAA0C;IAIvE,WAAW;IAUjB;;;OAGG;IACG,aAAa,CAAC,QAAQ,EAAE,MAAM;IAmDpC;;;OAGG;IACH,KAAK,CAAC,MAAM,GAAE,WAAgB;IAwC9B;;;OAGG;IACH,UAAU,CAAC,OAAO,EAAE,QAAQ,CAAC,KAAK;IAkClC;;OAEG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,EAAE,UAAU,CAAC,EAAE,MAAM,EAAE;IA2DnD;;;;;;;;OAQG;IACH,0BAA0B,CAAC,cAAc,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;IAqCnE;;OAEG;IACH,SAAS;IAIT;;OAEG;IACH,eAAe,CAAC,CAAC,CAAC,EAAE,MAAM;IAQ1B;;;;;;;;OAQG;IACH,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,IAAI,EAAE,EAAE,YAAY,CAAC,EAAE,OAAO,EAAE,WAAW,GAAE,WAAyC,EAAE,cAAc,CAAC,EAAE,MAAM;IAgD7I;;;;;;OAMG;IACH,WAAW,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;CAU/C"}
|
|
@@ -3,15 +3,17 @@ import logger from '@wdio/logger';
|
|
|
3
3
|
import RequireLibrary from './RequireLibrary.js';
|
|
4
4
|
import FileSystemPathService from './FileSystemPathService.js';
|
|
5
5
|
import { removeLineNumbers, isCucumberFeatureWithLineNumber, validObjectOrArray, loadAutoCompilers } from '../utils.js';
|
|
6
|
-
import { SUPPORTED_HOOKS, SUPPORTED_FILE_EXTENSIONS, DEFAULT_CONFIGS } from '../constants.js';
|
|
6
|
+
import { SUPPORTED_HOOKS, SUPPORTED_FILE_EXTENSIONS, DEFAULT_CONFIGS, NO_NAMED_CONFIG_EXPORT } from '../constants.js';
|
|
7
7
|
const log = logger('@wdio/config:ConfigParser');
|
|
8
8
|
const MERGE_OPTIONS = { clone: false };
|
|
9
9
|
export default class ConfigParser {
|
|
10
|
+
_pathService;
|
|
11
|
+
_moduleRequireService;
|
|
12
|
+
_config = DEFAULT_CONFIGS();
|
|
13
|
+
_capabilities = [];
|
|
10
14
|
constructor(_pathService = new FileSystemPathService(), _moduleRequireService = new RequireLibrary()) {
|
|
11
15
|
this._pathService = _pathService;
|
|
12
16
|
this._moduleRequireService = _moduleRequireService;
|
|
13
|
-
this._config = DEFAULT_CONFIGS();
|
|
14
|
-
this._capabilities = [];
|
|
15
17
|
}
|
|
16
18
|
async autoCompile() {
|
|
17
19
|
/**
|
|
@@ -32,9 +34,14 @@ export default class ConfigParser {
|
|
|
32
34
|
}
|
|
33
35
|
const filePath = this._pathService.ensureAbsolutePath(filename);
|
|
34
36
|
try {
|
|
35
|
-
|
|
37
|
+
/**
|
|
38
|
+
* Check if direct exports got assigned as default exports and if so
|
|
39
|
+
* be more flexible and pick allow for these as well.
|
|
40
|
+
*/
|
|
41
|
+
const importedModule = await this._pathService.loadFile(filePath);
|
|
42
|
+
const config = importedModule.config || importedModule.default?.config;
|
|
36
43
|
if (typeof config !== 'object') {
|
|
37
|
-
throw new Error(
|
|
44
|
+
throw new Error(NO_NAMED_CONFIG_EXPORT);
|
|
38
45
|
}
|
|
39
46
|
/**
|
|
40
47
|
* clone the original config
|
|
@@ -4,6 +4,7 @@ import path from 'node:path';
|
|
|
4
4
|
import glob from 'glob';
|
|
5
5
|
import RequireLibrary from './RequireLibrary.js';
|
|
6
6
|
export default class FileSystemPathService {
|
|
7
|
+
_moduleRequireService;
|
|
7
8
|
constructor(_moduleRequireService = new RequireLibrary()) {
|
|
8
9
|
this._moduleRequireService = _moduleRequireService;
|
|
9
10
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wdio/config",
|
|
3
|
-
"version": "8.0.0-alpha.
|
|
3
|
+
"version": "8.0.0-alpha.411+2d3189eaf",
|
|
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",
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
"url": "https://github.com/webdriverio/webdriverio/issues"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@wdio/logger": "8.0.0-alpha.
|
|
30
|
-
"@wdio/types": "8.0.0-alpha.
|
|
31
|
-
"@wdio/utils": "8.0.0-alpha.
|
|
29
|
+
"@wdio/logger": "8.0.0-alpha.411+2d3189eaf",
|
|
30
|
+
"@wdio/types": "8.0.0-alpha.411+2d3189eaf",
|
|
31
|
+
"@wdio/utils": "8.0.0-alpha.411+2d3189eaf",
|
|
32
32
|
"deepmerge": "^4.0.0",
|
|
33
33
|
"glob": "^8.0.3"
|
|
34
34
|
},
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"minimatch": "^5.0.0",
|
|
40
40
|
"tsconfig-paths": "^4.1.0"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "2d3189eaf8779f61699c1377f44f9841ed8a72c7"
|
|
43
43
|
}
|