browser-ava 2.3.39 → 2.3.40
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.
|
|
3
|
+
"version": "2.3.40",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"provenance": true
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
"commander": "^14.0.1",
|
|
42
42
|
"es-module-lexer": "^1.7.0",
|
|
43
43
|
"globby": "^15.0.0",
|
|
44
|
+
"json-cyclic": "^1.0.2",
|
|
44
45
|
"koa": "^3.0.1",
|
|
45
46
|
"koa-static": "^5.0.0",
|
|
46
47
|
"playwright": "^1.56.0",
|
package/src/browser/runtime.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { decycle } from "./node_modules/json-cyclic/dist/index.esm.js";
|
|
1
2
|
import { testModules, test } from "./ava.mjs";
|
|
2
3
|
import {
|
|
3
4
|
calculateSummary,
|
|
@@ -33,7 +34,7 @@ for (const action of ["log", "info", "error"]) {
|
|
|
33
34
|
|
|
34
35
|
console[action] = (...data) => {
|
|
35
36
|
if (ws) {
|
|
36
|
-
ws.send(JSON.stringify({ action, data }, allErrorProperties));
|
|
37
|
+
ws.send(JSON.stringify(decycle({ action, data }), allErrorProperties));
|
|
37
38
|
}
|
|
38
39
|
former(...data);
|
|
39
40
|
};
|
|
@@ -202,7 +203,7 @@ async function runTest(parent, tm, testInstance) {
|
|
|
202
203
|
} finally {
|
|
203
204
|
ws.send(
|
|
204
205
|
JSON.stringify(
|
|
205
|
-
{ action: "update", data: testInstance },
|
|
206
|
+
decycle({ action: "update", data: testInstance }),
|
|
206
207
|
allErrorProperties
|
|
207
208
|
)
|
|
208
209
|
);
|
|
@@ -258,7 +259,7 @@ async function runTestModules() {
|
|
|
258
259
|
}
|
|
259
260
|
|
|
260
261
|
ws.send(
|
|
261
|
-
JSON.stringify({ action: "result", data: testModules }, allErrorProperties)
|
|
262
|
+
JSON.stringify(decycle({ action: "result", data: testModules }), allErrorProperties)
|
|
262
263
|
);
|
|
263
264
|
|
|
264
265
|
displayTests();
|
package/src/browser-ava-cli.mjs
CHANGED
|
@@ -12,6 +12,7 @@ import { calculateSummary, summaryMessages } from "./browser/util.mjs";
|
|
|
12
12
|
import { resolveImport, utf8EncodingOptions } from "./resolver.mjs";
|
|
13
13
|
import { globby } from "globby";
|
|
14
14
|
import chalk from "chalk";
|
|
15
|
+
import { encycle } from "json-cyclic";
|
|
15
16
|
import pkg from "../package.json" with { type: "json" };
|
|
16
17
|
|
|
17
18
|
const knownBrowsers = {
|
|
@@ -106,7 +107,7 @@ program
|
|
|
106
107
|
|
|
107
108
|
wss.on("connection", ws => {
|
|
108
109
|
ws.on("message", async content => {
|
|
109
|
-
const { action, data } = JSON.parse(content);
|
|
110
|
+
const { action, data } = encycle(JSON.parse(content));
|
|
110
111
|
switch (action) {
|
|
111
112
|
case "info":
|
|
112
113
|
console.info(...data);
|
|
@@ -226,6 +227,7 @@ async function createServer(tests, options) {
|
|
|
226
227
|
app.use(Cors({ origin: "*" }));
|
|
227
228
|
|
|
228
229
|
app.use(Static(new URL("./browser", import.meta.url).pathname));
|
|
230
|
+
app.use(Static(new URL("..", import.meta.url).pathname));
|
|
229
231
|
|
|
230
232
|
app.on("error", console.error);
|
|
231
233
|
|