as-test 1.1.5 → 1.1.7
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/CHANGELOG.md +16 -1
- package/README.md +4 -9
- package/assembly/index.ts +10 -15
- package/assembly/src/expectation.ts +11 -11
- package/assembly/src/fuzz.ts +11 -7
- package/assembly/src/log.ts +2 -2
- package/assembly/src/suite.ts +5 -5
- package/assembly/src/tests.ts +8 -8
- package/assembly/util/wipc.ts +5 -1
- package/bin/build-worker-pool.js +146 -142
- package/bin/build-worker.js +37 -34
- package/bin/commands/build-core.js +577 -465
- package/bin/commands/build.js +49 -29
- package/bin/commands/clean-core.js +120 -113
- package/bin/commands/clean.js +14 -8
- package/bin/commands/doctor-core.js +288 -289
- package/bin/commands/doctor.js +1 -1
- package/bin/commands/fuzz-core.js +467 -414
- package/bin/commands/fuzz.js +27 -10
- package/bin/commands/init-core.js +905 -794
- package/bin/commands/init.js +2 -2
- package/bin/commands/run-core.js +2675 -2344
- package/bin/commands/run.js +43 -25
- package/bin/commands/test.js +56 -32
- package/bin/commands/web-runner-source.js +1 -1
- package/bin/commands/web-session.js +516 -525
- package/bin/coverage-points.js +363 -341
- package/bin/crash-store.js +56 -66
- package/bin/index.js +4092 -3150
- package/bin/reporters/default.js +1090 -890
- package/bin/reporters/tap.js +319 -325
- package/bin/types.js +67 -67
- package/bin/util.js +1290 -1239
- package/bin/wipc.js +70 -73
- package/lib/build/index.d.ts +3 -1
- package/lib/build/index.js +1039 -1034
- package/lib/build/web-runner/client.js +1 -1
- package/lib/build/web-runner/html.js +1 -1
- package/lib/build/web-runner/worker.js +1 -1
- package/package.json +6 -3
- package/transform/lib/coverage.js +4 -4
- package/transform/lib/log.js +9 -5
- package/assembly/util/json.ts +0 -112
package/bin/build-worker.js
CHANGED
|
@@ -1,43 +1,46 @@
|
|
|
1
1
|
import { build } from "./commands/build-core.js";
|
|
2
2
|
process.env.AS_TEST_BUILD_API = "1";
|
|
3
3
|
process.on("message", async (message) => {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
4
|
+
if (!message || message.type != "build-file") return;
|
|
5
|
+
try {
|
|
6
|
+
await build(
|
|
7
|
+
message.configPath,
|
|
8
|
+
[message.file],
|
|
9
|
+
message.modeName,
|
|
10
|
+
message.featureToggles,
|
|
11
|
+
message.overrides,
|
|
12
|
+
);
|
|
13
|
+
send({
|
|
14
|
+
type: "done",
|
|
15
|
+
id: message.id,
|
|
16
|
+
});
|
|
17
|
+
} catch (error) {
|
|
18
|
+
send({
|
|
19
|
+
type: "error",
|
|
20
|
+
id: message.id,
|
|
21
|
+
error: serializeError(error),
|
|
22
|
+
});
|
|
23
|
+
}
|
|
20
24
|
});
|
|
21
25
|
function send(message) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
process.send(message);
|
|
26
|
+
if (!process.send) return;
|
|
27
|
+
process.send(message);
|
|
25
28
|
}
|
|
26
29
|
function serializeError(error) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
const out = {
|
|
34
|
-
name: error.name,
|
|
35
|
-
message: error.message,
|
|
36
|
-
stack: error.stack,
|
|
30
|
+
if (!(error instanceof Error)) {
|
|
31
|
+
return {
|
|
32
|
+
name: "Error",
|
|
33
|
+
message: typeof error == "string" ? error : "unknown error",
|
|
37
34
|
};
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
35
|
+
}
|
|
36
|
+
const out = {
|
|
37
|
+
name: error.name,
|
|
38
|
+
message: error.message,
|
|
39
|
+
stack: error.stack,
|
|
40
|
+
};
|
|
41
|
+
const errorRecord = error;
|
|
42
|
+
for (const key of Object.keys(error)) {
|
|
43
|
+
out[key] = errorRecord[key];
|
|
44
|
+
}
|
|
45
|
+
return out;
|
|
43
46
|
}
|