browser-ava 2.3.0 → 2.3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "browser-ava",
3
- "version": "2.3.0",
3
+ "version": "2.3.2",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "provenance": true
@@ -42,11 +42,11 @@
42
42
  "globby": "^14.0.2",
43
43
  "koa": "^2.15.3",
44
44
  "koa-static": "^5.0.0",
45
- "playwright": "^1.48.2",
45
+ "playwright": "^1.49.0",
46
46
  "ws": "^8.18.0"
47
47
  },
48
48
  "devDependencies": {
49
- "@types/node": "^22.8.7",
49
+ "@types/node": "^22.9.0",
50
50
  "ava": "^6.2.0",
51
51
  "c8": "^10.1.2",
52
52
  "documentation": "^14.0.3",
@@ -54,7 +54,7 @@
54
54
  "semantic-release": "^24.2.0"
55
55
  },
56
56
  "engines": {
57
- "node": ">=22.10.0",
57
+ "node": ">=22.11.0",
58
58
  "bun": ">=1.1"
59
59
  },
60
60
  "repository": {
@@ -16,6 +16,17 @@ function primitiveRoString() {
16
16
  BigInt.prototype.toJSON = primitiveRoString;
17
17
  Error.prototype.toJSON = primitiveRoString;
18
18
 
19
+ function allErrorProperties(key, value) {
20
+ if (value instanceof Error) {
21
+ const error = {};
22
+ Object.
23
+ getOwnPropertyNames(value).
24
+ forEach((key) => error[key] = value[key]);
25
+ return error;
26
+ }
27
+ return value;
28
+ }
29
+
19
30
  /*
20
31
  forward console info,log,error to the server
21
32
  */
@@ -24,7 +35,7 @@ for (const action of ["log", "info", "error"]) {
24
35
 
25
36
  console[action] = (...data) => {
26
37
  if (ws) {
27
- ws.send(JSON.stringify({ action, data }));
38
+ ws.send(JSON.stringify({ action, data }, allErrorProperties));
28
39
  }
29
40
  former(...data);
30
41
  };
@@ -189,7 +200,7 @@ async function runTest(parent, tm, testInstance) {
189
200
  testInstance.message = e;
190
201
  testInstance.stack = e.stack;
191
202
  } finally {
192
- ws.send(JSON.stringify({ action: "update", data: testInstance }));
203
+ ws.send(JSON.stringify({ action: "update", data: testInstance }, allErrorProperties));
193
204
  }
194
205
  }
195
206
  }
@@ -231,7 +242,7 @@ async function runTestModule(tm) {
231
242
  async function runTestModules() {
232
243
  await Promise.all(testModules.map(tm => runTestModule(tm)));
233
244
 
234
- ws.send(JSON.stringify({ action: "result", data: testModules }));
245
+ ws.send(JSON.stringify({ action: "result", data: testModules }, allErrorProperties));
235
246
 
236
247
  displayTests();
237
248
  }