browser-ava 1.3.5 → 1.3.6

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": "1.3.5",
3
+ "version": "1.3.6",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -3,7 +3,6 @@ import {
3
3
  calculateSummary,
4
4
  summaryMessages,
5
5
  pluralize,
6
- stringify,
7
6
  moduleName
8
7
  } from "./util.mjs";
9
8
  import { isEqual } from "./eql.mjs";
@@ -19,7 +18,7 @@ for (const slot of ["log", "info", "error"]) {
19
18
 
20
19
  console[slot] = (...args) => {
21
20
  if (ws) {
22
- ws.send(stringify({ action: slot, data: args }));
21
+ ws.send(JSON.stringify({ action: slot, data: args }));
23
22
  }
24
23
  former(...args);
25
24
  };
@@ -51,7 +50,7 @@ ws.onmessage = async message => {
51
50
 
52
51
  displayTests();
53
52
  if (errors === 0) {
54
- ws.send(stringify({ action: "ready" }));
53
+ ws.send(JSON.stringify({ action: "ready" }));
55
54
  }
56
55
  }
57
56
  break;
@@ -178,7 +177,7 @@ async function runTest(parent, tm, test) {
178
177
  test.passed = false;
179
178
  test.message = e;
180
179
  } finally {
181
- ws.send(stringify({ action: "update", data: test }));
180
+ ws.send(JSON.stringify({ action: "update", data: test }));
182
181
  }
183
182
  }
184
183
  }
@@ -220,7 +219,7 @@ async function runTestModule(tm) {
220
219
  async function runTestModules() {
221
220
  await Promise.all(testModules.map(tm => runTestModule(tm)));
222
221
 
223
- ws.send(stringify({ action: "result", data: testModules }));
222
+ ws.send(JSON.stringify({ action: "result", data: testModules }));
224
223
 
225
224
  displayTests();
226
225
  }
@@ -67,17 +67,6 @@ export function summaryMessages(summary) {
67
67
  return messages;
68
68
  }
69
69
 
70
- /**
71
- * @TODO HACK to be able to sent BigInt
72
- */
73
- export function stringify(...args) {
74
- const former = BigInt.prototype.toJSON;
75
- BigInt.prototype.toJSON = (v) => v.toString();
76
- const string = JSON.stringify(...args);
77
- BigInt.prototype.toJSON = former;
78
- return string;
79
- }
80
-
81
70
  export function moduleName(url) {
82
71
  return url.replace(/\.m?js$/,'')
83
72
  }