browser-ava 2.3.38 → 2.3.39

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.38",
3
+ "version": "2.3.39",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "provenance": true
@@ -18,11 +18,9 @@ Error.prototype.toJSON = primitiveRoString;
18
18
 
19
19
  function allErrorProperties(key, value) {
20
20
  if (value instanceof Error) {
21
- const error = {};
22
- Object.
23
- getOwnPropertyNames(value).
24
- forEach((key) => error[key] = value[key]);
25
- return error;
21
+ const error = {};
22
+ Object.getOwnPropertyNames(value).forEach(key => (error[key] = value[key]));
23
+ return error;
26
24
  }
27
25
  return value;
28
26
  }
@@ -96,7 +94,9 @@ async function displayTests() {
96
94
  .map(a => (a.title || "") + " " + (a.message || ""))
97
95
  .join(" ")
98
96
  : ""
99
- }</span>${t.message ? t.message : ""}${t.stack ? "<br>" + t.stack : ""}</li>`;
97
+ }</span>${t.message ? t.message : ""}${
98
+ t.stack ? "<br>" + t.stack : ""
99
+ }</li>`;
100
100
  }
101
101
 
102
102
  function renderModule(tm) {
@@ -200,7 +200,12 @@ async function runTest(parent, tm, testInstance) {
200
200
  testInstance.message = e;
201
201
  testInstance.stack = e.stack;
202
202
  } finally {
203
- ws.send(JSON.stringify({ action: "update", data: testInstance }, allErrorProperties));
203
+ ws.send(
204
+ JSON.stringify(
205
+ { action: "update", data: testInstance },
206
+ allErrorProperties
207
+ )
208
+ );
204
209
  }
205
210
  }
206
211
  }
@@ -240,14 +245,21 @@ async function runTestModule(tm) {
240
245
  }
241
246
 
242
247
  async function runTestModules() {
243
- try {
244
- await Promise.all(testModules.map(tm => runTestModule(tm)));
245
- }
246
- catch(error) {
247
- console.error(error);
248
+ const results = await Promise.allSettled(
249
+ testModules.map(tm => runTestModule(tm))
250
+ );
251
+
252
+ let i = 0;
253
+ for (const result of results) {
254
+ if (result.status !== "fulfilled") {
255
+ console.error(testModules[i].url, result.reason);
256
+ i++;
257
+ }
248
258
  }
249
259
 
250
- ws.send(JSON.stringify({ action: "result", data: testModules }, allErrorProperties));
260
+ ws.send(
261
+ JSON.stringify({ action: "result", data: testModules }, allErrorProperties)
262
+ );
251
263
 
252
264
  displayTests();
253
265
  }