@wdio/browser-runner 8.36.1 → 8.37.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.
@@ -1 +1 @@
1
- {"version":3,"file":"mocha.d.ts","sourceRoot":"","sources":["../../../src/browser/frameworks/mocha.ts"],"names":[],"mappings":"AA6BA,qBAAa,cAAe,SAAQ,WAAW;;;IAyB3C,MAAM,KAAK,kBAAkB,aAE5B;IAED,IAAI,IAAI,WAEP;IAED,iBAAiB;IAWjB,wBAAwB,CAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO;IAatE,GAAG;CA+IZ"}
1
+ {"version":3,"file":"mocha.d.ts","sourceRoot":"","sources":["../../../src/browser/frameworks/mocha.ts"],"names":[],"mappings":"AA6BA,qBAAa,cAAe,SAAQ,WAAW;;;IAyB3C,MAAM,KAAK,kBAAkB,aAE5B;IAED,IAAI,IAAI,WAEP;IAED,iBAAiB;IAWjB,wBAAwB,CAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO;IAatE,GAAG;CAoKZ"}
@@ -173,10 +173,30 @@ export class MochaFramework extends HTMLElement {
173
173
  }
174
174
  this.#hookResolver.set(id, { resolve, reject });
175
175
  args = args.map((arg) => {
176
- if (typeof arg === 'object') {
176
+ // Check for test argument and file to that argument.
177
+ if (typeof arg === 'object' && 'type' in arg && 'title' in arg) {
177
178
  const { type, title, body, async, sync, timedOut, pending, parent } = arg;
178
179
  return { type, title, body, async, sync, timedOut, pending, parent, file: this.#spec };
179
180
  }
181
+ // Check for error and convert error class to serializable Object.
182
+ if (typeof arg === 'object' && 'error' in arg && arg.error instanceof Error) {
183
+ const errorObject = {
184
+ // Pull all enumerable properties, supporting properties on custom Errors
185
+ ...arg.error,
186
+ // Explicitly pull Error's non-enumerable properties
187
+ message: arg.error.message,
188
+ name: arg.error.name,
189
+ stack: arg.error.stack,
190
+ type: arg.error.type || arg.error.name,
191
+ matcherResult: arg.error.matcherResult,
192
+ expected: arg.error.expected,
193
+ actual: arg.error.actual
194
+ };
195
+ return {
196
+ ...arg,
197
+ error: errorObject
198
+ };
199
+ }
180
200
  return arg;
181
201
  });
182
202
  import.meta.hot?.send(WDIO_EVENT_NAME, this.#hookTrigger({ name, id, cid, args }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wdio/browser-runner",
3
- "version": "8.36.1",
3
+ "version": "8.37.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",
@@ -37,14 +37,14 @@
37
37
  "@originjs/vite-plugin-commonjs": "^1.0.3",
38
38
  "@types/istanbul-lib-source-maps": "^4.0.1",
39
39
  "@vitest/spy": "^1.0.1",
40
- "@wdio/globals": "8.36.1",
41
- "@wdio/local-runner": "8.36.1",
40
+ "@wdio/globals": "8.37.0",
41
+ "@wdio/local-runner": "8.37.0",
42
42
  "@wdio/logger": "8.28.0",
43
- "@wdio/mocha-framework": "8.36.1",
43
+ "@wdio/mocha-framework": "8.37.0",
44
44
  "@wdio/protocols": "8.32.0",
45
- "@wdio/runner": "8.36.1",
46
- "@wdio/types": "8.36.1",
47
- "@wdio/utils": "8.36.1",
45
+ "@wdio/runner": "8.37.0",
46
+ "@wdio/types": "8.37.0",
47
+ "@wdio/utils": "8.37.0",
48
48
  "deepmerge-ts": "^5.0.0",
49
49
  "expect": "^29.7.0",
50
50
  "expect-webdriverio": "^4.11.2",
@@ -62,8 +62,8 @@
62
62
  "vite": "~4.5.0",
63
63
  "vite-plugin-istanbul": "^6.0.0",
64
64
  "vite-plugin-top-level-await": "^1.3.0",
65
- "webdriver": "8.36.1",
66
- "webdriverio": "8.36.1"
65
+ "webdriver": "8.37.0",
66
+ "webdriverio": "8.37.0"
67
67
  },
68
68
  "scripts": {
69
69
  "prepare": "rimraf node_modules/@wdio/config node_modules/@wdio/repl node_modules/@wdio/utils"
@@ -71,5 +71,5 @@
71
71
  "publishConfig": {
72
72
  "access": "public"
73
73
  },
74
- "gitHead": "6c4a9745052c29d13b73ac622dfda387c884ffd8"
74
+ "gitHead": "cefb415aa315075fb6b682c6d059d9ff37fbefb8"
75
75
  }