@wdio/browser-runner 8.18.2 → 8.20.0

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.
@@ -125,7 +125,7 @@ export default class ProxyDriver {
125
125
  for (const method of CONSOLE_METHODS) {
126
126
  const origCommand = console[method].bind(console);
127
127
  console[method] = (...args) => {
128
- socket.send(stringify(this.#consoleMessage({
128
+ socket.send(stringify.default(this.#consoleMessage({
129
129
  name: 'consoleEvent',
130
130
  type: method,
131
131
  args,
@@ -176,7 +176,7 @@ export class MochaFramework extends HTMLElement {
176
176
  return reject(new Error('"cid" query parameter is missing'));
177
177
  }
178
178
  this.#hookResolver.set(id.toString(), { resolve, reject });
179
- this.#socket?.send(stringify(this.#hookTrigger({ name, id, cid, args })));
179
+ this.#socket?.send(stringify.default(this.#hookTrigger({ name, id, cid, args })));
180
180
  });
181
181
  }
182
182
  #hookTrigger(value) {
@@ -1,5 +1,5 @@
1
1
  import type { MaybeMocked } from '@vitest/spy';
2
- import type { MockFactoryWithHelper } from '../types';
2
+ import type { MockFactoryWithHelper } from '../types.js';
3
3
  /**
4
4
  * re-export mock module
5
5
  */
@@ -1 +1 @@
1
- {"version":3,"file":"spy.d.ts","sourceRoot":"","sources":["../../src/browser/spy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAE9C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAErD;;GAEG;AACH,cAAc,aAAa,CAAA;AAS3B,wBAAsB,IAAI,CAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,qBAAqB,iBA2BxE;AAGD,wBAAgB,MAAM,CAAC,UAAU,EAAE,MAAM,QAExC;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,kBAA0C"}
1
+ {"version":3,"file":"spy.d.ts","sourceRoot":"","sources":["../../src/browser/spy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAE9C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAExD;;GAEG;AACH,cAAc,aAAa,CAAA;AAS3B,wBAAsB,IAAI,CAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,qBAAqB,iBA2BxE;AAGD,wBAAgB,MAAM,CAAC,UAAU,EAAE,MAAM,QAExC;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,kBAA0C"}
@@ -1,5 +1,5 @@
1
1
  import type { Options } from '@wdio/types';
2
- import type { MockRequestEvent } from './types';
2
+ import type { MockRequestEvent } from './types.js';
3
3
  export declare class MockHandler {
4
4
  #private;
5
5
  manualMocks: string[];
@@ -1 +1 @@
1
- {"version":3,"file":"mock.d.ts","sourceRoot":"","sources":["../../src/vite/mock.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAI1C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAI/C,qBAAa,WAAW;;IAOpB,WAAW,EAAE,MAAM,EAAE,CAAK;gBAEb,OAAO,EAAE,WAAW,CAAC,oBAAoB,EAAE,MAAM,EAAE,OAAO,CAAC,UAAU;IAMlF,IAAI,KAAK,kCAER;IAED,MAAM,CAAE,UAAU,EAAE,MAAM;IAIpB,SAAS,CAAE,EAAE,EAAE,MAAM;IAwB3B;;OAEG;IACH,UAAU;CAIb"}
1
+ {"version":3,"file":"mock.d.ts","sourceRoot":"","sources":["../../src/vite/mock.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAI1C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAIlD,qBAAa,WAAW;;IAOpB,WAAW,EAAE,MAAM,EAAE,CAAK;gBAEb,OAAO,EAAE,WAAW,CAAC,oBAAoB,EAAE,MAAM,EAAE,OAAO,CAAC,UAAU;IAMlF,IAAI,KAAK,kCAER;IAED,MAAM,CAAE,UAAU,EAAE,MAAM;IAIpB,SAAS,CAAE,EAAE,EAAE,MAAM;IAwB3B;;OAEG;IACH,UAAU;CAIb"}
@@ -24,7 +24,7 @@ const resolvedVirtualModuleId = '\0' + virtualModuleId;
24
24
  const MODULES_TO_MOCK = [
25
25
  'import-meta-resolve', 'puppeteer-core', 'archiver', 'glob', 'devtools', 'ws', 'decamelize', 'got',
26
26
  'geckodriver', 'safaridriver', 'edgedriver', '@puppeteer/browsers', 'locate-app', 'wait-port',
27
- 'lodash.isequal'
27
+ 'lodash.isequal', '@wdio/repl'
28
28
  ];
29
29
  const POLYFILLS = [
30
30
  ...builtinModules,
@@ -1,4 +1,4 @@
1
- /// <reference types="node" />
1
+ /// <reference types="node" resolution-mode="require"/>
2
2
  import { EventEmitter } from 'node:events';
3
3
  import { WebSocketServer } from 'ws';
4
4
  import type { InlineConfig } from 'vite';
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/vite/server.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAM1C,OAAO,EAAE,eAAe,EAAE,MAAM,IAAI,CAAA;AAGpC,OAAO,KAAK,EAAiB,YAAY,EAAa,MAAM,MAAM,CAAA;AAGlE,OAAO,KAAK,EAAY,OAAO,EAAE,MAAM,aAAa,CAAA;AAQpD,OAAO,KAAK,EACM,gBAAgB,EAEjC,MAAM,YAAY,CAAA;AAgBnB,qBAAa,UAAW,SAAQ,YAAY;;IAUxC,IAAI,YAAY,gCAEf;IAED,IAAI,MAAM,0BAET;gBAEY,OAAO,EAAE,WAAW,CAAC,oBAAoB,EAAE,MAAM,EAAE,OAAO,CAAC,UAAU,EAAE,aAAa,EAAE,YAAY;IA2BzG,KAAK;IAuDL,KAAK;IA2IX,OAAO,CAAC,cAAc;IAetB,WAAW,CAAE,MAAM,EAAE,gBAAgB;CAUxC"}
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/vite/server.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAM1C,OAAO,EAAE,eAAe,EAAE,MAAM,IAAI,CAAA;AAGpC,OAAO,KAAK,EAAiB,YAAY,EAAa,MAAM,MAAM,CAAA;AAGlE,OAAO,KAAK,EAAY,OAAO,EAAE,MAAM,aAAa,CAAA;AAQpD,OAAO,KAAK,EACM,gBAAgB,EAEjC,MAAM,YAAY,CAAA;AAgBnB,qBAAa,UAAW,SAAQ,YAAY;;IAUxC,IAAI,YAAY,gCAEf;IAED,IAAI,MAAM,0BAET;gBAEY,OAAO,EAAE,WAAW,CAAC,oBAAoB,EAAE,MAAM,EAAE,OAAO,CAAC,UAAU,EAAE,aAAa,EAAE,YAAY;IA8BzG,KAAK;IAuDL,KAAK;IA2IX,OAAO,CAAC,cAAc;IAetB,WAAW,CAAE,MAAM,EAAE,gBAAgB;CAUxC"}
@@ -51,7 +51,10 @@ export class ViteServer extends EventEmitter {
51
51
  });
52
52
  if (options.coverage && options.coverage.enabled) {
53
53
  log.info('Capturing test coverage enabled');
54
- this.#viteConfig.plugins?.push(istanbulPlugin({
54
+ // @ts-expect-error istanbul plugin seems to incorrectly export
55
+ // its type for our setup
56
+ const plugin = istanbulPlugin;
57
+ this.#viteConfig.plugins?.push(plugin({
55
58
  cwd: config.rootDir,
56
59
  include: DEFAULT_INCLUDE,
57
60
  extension: DEFAULT_FILE_EXTENSIONS,
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/vite/utils.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAI/D,wBAAsB,WAAW,CAAC,OAAO,EAAE,WAAW,CAAC,oBAAoB,EAAE,GAAG,EAA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BAEhC;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,UAU9D"}
@@ -46,6 +46,9 @@ export async function getTemplate(options, env, spec, p = process) {
46
46
  catch (err) {
47
47
  log.error(`Failed to setup source-map-support: ${err.message}`);
48
48
  }
49
+ const mochaPath = await resolve('mocha', `${rootFileUrl}/node_modules`);
50
+ const mochaCSSHref = path.join(url.fileURLToPath(path.dirname(mochaPath)), 'mocha.css');
51
+ const mochaJSSrc = path.join(url.fileURLToPath(path.dirname(mochaPath)), 'mocha.js');
49
52
  return /* html */ `
50
53
  <!doctype html>
51
54
  <html>
@@ -78,7 +81,8 @@ export async function getTemplate(options, env, spec, p = process) {
78
81
  return mod
79
82
  }
80
83
  </script>
81
- <script type="module" src="/node_modules/mocha/mocha.js"></script>
84
+ <link rel="stylesheet" href="/@fs/${mochaCSSHref}">
85
+ <script type="module" src="/@fs/${mochaJSSrc}"></script>
82
86
  ${sourceMapScript}
83
87
  <script type="module">
84
88
  ${sourceMapSetupCommand}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wdio/browser-runner",
3
- "version": "8.18.2",
3
+ "version": "8.20.0",
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",
@@ -35,13 +35,13 @@
35
35
  "@types/istanbul-lib-source-maps": "^4.0.1",
36
36
  "@types/node": "^20.1.0",
37
37
  "@vitest/spy": "^0.34.1",
38
- "@wdio/globals": "8.18.2",
39
- "@wdio/local-runner": "8.18.2",
38
+ "@wdio/globals": "8.20.0",
39
+ "@wdio/local-runner": "8.20.0",
40
40
  "@wdio/logger": "8.16.17",
41
- "@wdio/mocha-framework": "8.18.2",
41
+ "@wdio/mocha-framework": "8.20.0",
42
42
  "@wdio/protocols": "8.18.0",
43
- "@wdio/types": "8.17.0",
44
- "@wdio/utils": "8.18.2",
43
+ "@wdio/types": "8.20.0",
44
+ "@wdio/utils": "8.20.0",
45
45
  "ast-types": "^0.14.2",
46
46
  "deepmerge-ts": "^5.0.0",
47
47
  "expect-webdriverio": "^4.2.5",
@@ -60,8 +60,8 @@
60
60
  "vite": "~4.4.6",
61
61
  "vite-plugin-istanbul": "^5.0.0",
62
62
  "vite-plugin-top-level-await": "^1.3.0",
63
- "webdriver": "8.18.2",
64
- "webdriverio": "8.18.2",
63
+ "webdriver": "8.20.0",
64
+ "webdriverio": "8.20.0",
65
65
  "ws": "^8.13.0"
66
66
  },
67
67
  "scripts": {
@@ -72,7 +72,7 @@
72
72
  },
73
73
  "devDependencies": {
74
74
  "@types/ws": "^8.5.4",
75
- "@wdio/runner": "8.18.2"
75
+ "@wdio/runner": "8.20.0"
76
76
  },
77
- "gitHead": "910c79f1640f0100e763a507fdcaee9e4f52560f"
77
+ "gitHead": "6aa9e33233a6abc832bb16d2e24aaaa382e206b6"
78
78
  }