@wdio/browser-runner 8.6.0 → 8.6.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.
- package/build/browser/frameworks/mocha.d.ts.map +1 -1
- package/build/browser/frameworks/mocha.js +0 -1
- package/build/browser/mock.d.ts +0 -3
- package/build/browser/mock.d.ts.map +1 -1
- package/build/browser/mock.js +0 -4
- package/build/browser/setup.js +4 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +6 -2
- package/build/vite/constants.d.ts.map +1 -1
- package/build/vite/constants.js +4 -2
- package/build/vite/plugins/esbuild.d.ts +3 -0
- package/build/vite/plugins/esbuild.d.ts.map +1 -0
- package/build/vite/plugins/esbuild.js +25 -0
- package/build/vite/plugins/testrunner.d.ts.map +1 -1
- package/build/vite/plugins/testrunner.js +1 -2
- package/package.json +9 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mocha.d.ts","sourceRoot":"","sources":["../../../src/browser/frameworks/mocha.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mocha.d.ts","sourceRoot":"","sources":["../../../src/browser/frameworks/mocha.ts"],"names":[],"mappings":"AA8BA,qBAAa,cAAe,SAAQ,WAAW;;;IAuB3C,MAAM,KAAK,kBAAkB,aAE5B;IAED,iBAAiB;IAWjB,wBAAwB,CAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO;IAatE,GAAG,CAAE,MAAM,EAAE,SAAS;CAkG/B"}
|
package/build/browser/mock.d.ts
CHANGED
|
@@ -21,9 +21,6 @@ export declare const dirname: () => string;
|
|
|
21
21
|
export declare const resolve: () => string;
|
|
22
22
|
export declare const sep = "/";
|
|
23
23
|
export declare const type = "browser";
|
|
24
|
-
export declare const printDiffOrStringify: () => void;
|
|
25
|
-
export declare const printReceived: () => void;
|
|
26
|
-
export declare const printExpected: () => void;
|
|
27
24
|
declare const _default: () => void;
|
|
28
25
|
export default _default;
|
|
29
26
|
//# sourceMappingURL=mock.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mock.d.ts","sourceRoot":"","sources":["../../src/browser/mock.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,aAAa;;;CAIzB,CAAA;AAED,eAAO,MAAM,iBAAiB,SAAK,CAAA;AACnC,eAAO,MAAM,eAAe,IAAK,CAAA;AACjC,qBAAa,YAAY;CAAG;AAC5B,eAAO,MAAM,GAAG;;;;;CAAa,CAAA;AAC7B,eAAO,MAAM,aAAa,cAAW,CAAA;AACrC,eAAO,MAAM,aAAa,cAAW,CAAA;AACrC,eAAO,MAAM,OAAO,cAAW,CAAA;AAC/B,eAAO,MAAM,OAAO,cAAW,CAAA;AAC/B,eAAO,MAAM,GAAG,MAAM,CAAA;AACtB,eAAO,MAAM,IAAI,YAAY,CAAA
|
|
1
|
+
{"version":3,"file":"mock.d.ts","sourceRoot":"","sources":["../../src/browser/mock.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,aAAa;;;CAIzB,CAAA;AAED,eAAO,MAAM,iBAAiB,SAAK,CAAA;AACnC,eAAO,MAAM,eAAe,IAAK,CAAA;AACjC,qBAAa,YAAY;CAAG;AAC5B,eAAO,MAAM,GAAG;;;;;CAAa,CAAA;AAC7B,eAAO,MAAM,aAAa,cAAW,CAAA;AACrC,eAAO,MAAM,aAAa,cAAW,CAAA;AACrC,eAAO,MAAM,OAAO,cAAW,CAAA;AAC/B,eAAO,MAAM,OAAO,cAAW,CAAA;AAC/B,eAAO,MAAM,GAAG,MAAM,CAAA;AACtB,eAAO,MAAM,IAAI,YAAY,CAAA;;AAC7B,wBAAuB"}
|
package/build/browser/mock.js
CHANGED
|
@@ -17,8 +17,4 @@ export const dirname = () => '';
|
|
|
17
17
|
export const resolve = () => '';
|
|
18
18
|
export const sep = '/';
|
|
19
19
|
export const type = 'browser';
|
|
20
|
-
// mock jest-matcher-utils exports
|
|
21
|
-
export const printDiffOrStringify = () => { };
|
|
22
|
-
export const printReceived = () => { };
|
|
23
|
-
export const printExpected = () => { };
|
|
24
20
|
export default () => { };
|
package/build/browser/setup.js
CHANGED
|
@@ -25,8 +25,11 @@ _setGlobal('driver', browser, window.__wdioEnv__.injectGlobals);
|
|
|
25
25
|
_setGlobal('expect', expect, window.__wdioEnv__.injectGlobals);
|
|
26
26
|
_setGlobal('$', browser.$.bind(browser), window.__wdioEnv__.injectGlobals);
|
|
27
27
|
_setGlobal('$$', browser.$$.bind(browser), window.__wdioEnv__.injectGlobals);
|
|
28
|
+
/**
|
|
29
|
+
* run framework immediatelly on page load
|
|
30
|
+
*/
|
|
28
31
|
const mochaFramework = document.querySelector('mocha-framework');
|
|
29
32
|
if (mochaFramework) {
|
|
30
|
-
await connectPromise;
|
|
33
|
+
const socket = await connectPromise;
|
|
31
34
|
mochaFramework.run(socket);
|
|
32
35
|
}
|
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,WAAW,MAAM,oBAAoB,CAAA;AAO5C,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAEjE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAA;AAS/G,OAAO,KAAK,EAAE,oBAAoB,IAAI,0BAA0B,EAAmB,qBAAqB,EAAE,MAAM,YAAY,CAAA;AAG5H,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,WAAW;;IAU9C,OAAO,CAAC,OAAO;IACf,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,UAAU;IAJzC,OAAO,CAAC,aAAa,CAAoB;gBAG7B,OAAO,EAAE,0BAA0B,EAC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;;;;GAgBG;AACH,wBAAgB,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG,eAAe,CAAC,CAAC,CAAC,CAAA;AACnE,wBAAgB,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,CAAC,EAAE,KAAK,GAAG,eAAe,CAAC,CAAC,CAAC,CAAA;AACpE,wBAAgB,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE;IACxC,OAAO,CAAC,EAAE,KAAK,CAAC;IAChB,IAAI,CAAC,EAAE,KAAK,CAAC;CAChB,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;AACnB,wBAAgB,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE;IACxC,OAAO,CAAC,EAAE,KAAK,CAAC;IAChB,IAAI,EAAE,IAAI,CAAC;CACd,GAAG,eAAe,CAAC,CAAC,CAAC,CAAC;AACvB,wBAAgB,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE;IACxC,OAAO,EAAE,IAAI,CAAC;IACd,IAAI,CAAC,EAAE,KAAK,CAAC;CAChB,GAAG,oBAAoB,CAAC,CAAC,CAAC,CAAC;AAC5B,wBAAgB,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE;IACxC,OAAO,EAAE,IAAI,CAAC;IACd,IAAI,EAAE,IAAI,CAAC;CACd,GAAG,wBAAwB,CAAC,CAAC,CAAC,CAAA"}
|
package/build/index.js
CHANGED
|
@@ -59,12 +59,16 @@ export default class BrowserRunner extends LocalRunner {
|
|
|
59
59
|
runArgs.args.baseUrl = this._config.baseUrl;
|
|
60
60
|
}
|
|
61
61
|
const worker = super.run(runArgs);
|
|
62
|
-
this.#server.on('debugState', (state) => worker.postMessage('switchDebugState', state));
|
|
62
|
+
this.#server.on('debugState', (state) => worker.postMessage('switchDebugState', state, true));
|
|
63
63
|
this.#server.on('workerHookExecution', (payload) => {
|
|
64
64
|
if (worker.cid !== payload.cid) {
|
|
65
65
|
return;
|
|
66
66
|
}
|
|
67
|
-
|
|
67
|
+
if (worker.isKilled) {
|
|
68
|
+
log.debug(`Worker with cid ${payload.cid} was killed, skipping hook execution`);
|
|
69
|
+
return process.nextTick(() => this.#server.resolveHook(payload));
|
|
70
|
+
}
|
|
71
|
+
return worker.postMessage('workerHookExecution', payload, true);
|
|
68
72
|
});
|
|
69
73
|
worker.on('message', this.#onWorkerMessage.bind(this));
|
|
70
74
|
return worker;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/vite/constants.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/vite/constants.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AAGxC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAElD,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,eAAe,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS,CAgB1F,CAAA;AAED,eAAO,MAAM,mBAAmB,EAAE,OAAO,CAAC,YAAY,CAkCrD,CAAA"}
|
package/build/vite/constants.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import topLevelAwait from 'vite-plugin-top-level-await';
|
|
2
2
|
import { esbuildCommonjs } from '@originjs/vite-plugin-commonjs';
|
|
3
|
+
import { codeFrameFix } from './plugins/esbuild.js';
|
|
3
4
|
export const PRESET_DEPENDENCIES = {
|
|
4
5
|
react: ['@vitejs/plugin-react', 'default', {
|
|
5
6
|
babel: {
|
|
@@ -36,7 +37,7 @@ export const DEFAULT_VITE_CONFIG = {
|
|
|
36
37
|
'expect', 'serialize-error', 'minimatch', 'css-shorthand-properties',
|
|
37
38
|
'lodash.merge', 'lodash.zip', 'lodash.clonedeep', 'lodash.pickby', 'lodash.flattendeep',
|
|
38
39
|
'aria-query', 'grapheme-splitter', 'css-value', 'rgb2hex', 'p-iteration', 'fast-safe-stringify',
|
|
39
|
-
'deepmerge-ts', 'jest-util'
|
|
40
|
+
'deepmerge-ts', 'jest-util', 'jest-matcher-utils'
|
|
40
41
|
],
|
|
41
42
|
esbuildOptions: {
|
|
42
43
|
logLevel: 'silent',
|
|
@@ -46,7 +47,8 @@ export const DEFAULT_VITE_CONFIG = {
|
|
|
46
47
|
},
|
|
47
48
|
// Enable esbuild polyfill plugins
|
|
48
49
|
plugins: [
|
|
49
|
-
esbuildCommonjs(['@testing-library/vue'])
|
|
50
|
+
esbuildCommonjs(['@testing-library/vue']),
|
|
51
|
+
codeFrameFix()
|
|
50
52
|
],
|
|
51
53
|
},
|
|
52
54
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"esbuild.d.ts","sourceRoot":"","sources":["../../../src/vite/plugins/esbuild.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAe,MAAM,SAAS,CAAA;AAElD,wBAAgB,YAAY,WA8B3B"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import fs from 'node:fs/promises';
|
|
2
|
+
export function codeFrameFix() {
|
|
3
|
+
return {
|
|
4
|
+
name: 'wdio:codeFrameFix',
|
|
5
|
+
setup(build) {
|
|
6
|
+
build.onLoad({ filter: /@babel\/code-frame/, namespace: 'file' },
|
|
7
|
+
/**
|
|
8
|
+
* mock @babel/code-frame as it fails in Safari due
|
|
9
|
+
* to usage of chalk
|
|
10
|
+
*/
|
|
11
|
+
async ({ path: id }) => {
|
|
12
|
+
const code = await fs.readFile(id).then((buf) => buf.toString(), () => undefined);
|
|
13
|
+
if (!code) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
return {
|
|
17
|
+
contents: code.replace('require("@babel/highlight");', /*js*/ `{
|
|
18
|
+
shouldHighlight: false,
|
|
19
|
+
reset: () => {}
|
|
20
|
+
}`)
|
|
21
|
+
};
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testrunner.d.ts","sourceRoot":"","sources":["../../../src/vite/plugins/testrunner.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"testrunner.d.ts","sourceRoot":"","sources":["../../../src/vite/plugins/testrunner.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AA0ClC,wBAAgB,UAAU,CAAC,OAAO,EAAE,WAAW,CAAC,oBAAoB,GAAG,MAAM,EAAE,CAoH9E"}
|
|
@@ -22,8 +22,7 @@ const resolvedVirtualModuleId = '\0' + virtualModuleId;
|
|
|
22
22
|
* functionality
|
|
23
23
|
*/
|
|
24
24
|
const MODULES_TO_MOCK = [
|
|
25
|
-
'import-meta-resolve', 'puppeteer-core', 'archiver', 'glob', 'devtools', 'ws',
|
|
26
|
-
'jest-matcher-utils', 'decamelize'
|
|
25
|
+
'import-meta-resolve', 'puppeteer-core', 'archiver', 'glob', 'devtools', 'ws', 'decamelize'
|
|
27
26
|
];
|
|
28
27
|
const POLYFILLS = [
|
|
29
28
|
...builtinModules,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wdio/browser-runner",
|
|
3
|
-
"version": "8.6.
|
|
3
|
+
"version": "8.6.2",
|
|
4
4
|
"description": "A WebdriverIO runner to run unit tests tests in the browser.",
|
|
5
5
|
"author": "Christian Bromann <mail@bromann.dev>",
|
|
6
6
|
"homepage": "https://github.com/webdriverio/webdriverio/tree/main/packages/wdio-browser-runner",
|
|
@@ -32,13 +32,13 @@
|
|
|
32
32
|
"@types/istanbul-lib-source-maps": "^4.0.1",
|
|
33
33
|
"@types/node": "^18.14.0",
|
|
34
34
|
"@vitest/spy": "^0.29.1",
|
|
35
|
-
"@wdio/globals": "8.6.
|
|
36
|
-
"@wdio/local-runner": "8.6.
|
|
35
|
+
"@wdio/globals": "8.6.2",
|
|
36
|
+
"@wdio/local-runner": "8.6.2",
|
|
37
37
|
"@wdio/logger": "8.1.0",
|
|
38
|
-
"@wdio/mocha-framework": "8.
|
|
38
|
+
"@wdio/mocha-framework": "8.6.1",
|
|
39
39
|
"@wdio/protocols": "8.5.7",
|
|
40
40
|
"@wdio/types": "8.4.0",
|
|
41
|
-
"@wdio/utils": "8.
|
|
41
|
+
"@wdio/utils": "8.6.1",
|
|
42
42
|
"ast-types": "^0.14.2",
|
|
43
43
|
"deepmerge-ts": "^4.3.0",
|
|
44
44
|
"expect-webdriverio": "^4.1.2",
|
|
@@ -56,8 +56,8 @@
|
|
|
56
56
|
"vite": "^4.1.3",
|
|
57
57
|
"vite-plugin-istanbul": "^4.0.0",
|
|
58
58
|
"vite-plugin-top-level-await": "^1.2.4",
|
|
59
|
-
"webdriver": "8.6.
|
|
60
|
-
"webdriverio": "8.6.
|
|
59
|
+
"webdriver": "8.6.2",
|
|
60
|
+
"webdriverio": "8.6.2",
|
|
61
61
|
"ws": "^8.12.1"
|
|
62
62
|
},
|
|
63
63
|
"scripts": {
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"@types/ws": "^8.5.4",
|
|
71
|
-
"@wdio/runner": "8.6.
|
|
71
|
+
"@wdio/runner": "8.6.2"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "7d322b1b72a8af07e78b147a21ada220c4283eea"
|
|
74
74
|
}
|