@jsenv/test 3.4.1 → 3.4.3
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/dist/jsenv_test.js
CHANGED
|
@@ -4143,26 +4143,28 @@ const formatErrorForTerminal = (
|
|
|
4143
4143
|
error.site.url.startsWith("file:") &&
|
|
4144
4144
|
typeof error.site.line === "number"
|
|
4145
4145
|
) {
|
|
4146
|
-
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
|
|
4151
|
-
|
|
4152
|
-
|
|
4153
|
-
|
|
4154
|
-
|
|
4155
|
-
|
|
4156
|
-
|
|
4157
|
-
|
|
4158
|
-
|
|
4159
|
-
|
|
4160
|
-
|
|
4161
|
-
|
|
4162
|
-
|
|
4163
|
-
|
|
4164
|
-
|
|
4165
|
-
|
|
4146
|
+
try {
|
|
4147
|
+
const content = readFileSync(new URL(error.site.url), "utf8");
|
|
4148
|
+
text += generateContentFrame({
|
|
4149
|
+
content,
|
|
4150
|
+
line: error.site.line,
|
|
4151
|
+
column: error.site.column,
|
|
4152
|
+
linesAbove: 2,
|
|
4153
|
+
linesBelow: 0,
|
|
4154
|
+
lineMaxWidth: process.stdout.columns,
|
|
4155
|
+
format: (string, type) => {
|
|
4156
|
+
return {
|
|
4157
|
+
line_number_aside: () => ANSI.color(string, ANSI.GREY),
|
|
4158
|
+
char: () => string,
|
|
4159
|
+
marker_overflow_left: () => ANSI.color(string, ANSI.GREY),
|
|
4160
|
+
marker_overflow_right: () => ANSI.color(string, ANSI.GREY),
|
|
4161
|
+
marker_line: () => ANSI.color(string, ANSI.RED),
|
|
4162
|
+
marker_column: () => ANSI.color(string, ANSI.RED),
|
|
4163
|
+
}[type]();
|
|
4164
|
+
},
|
|
4165
|
+
});
|
|
4166
|
+
text += `\n`;
|
|
4167
|
+
} catch {}
|
|
4166
4168
|
}
|
|
4167
4169
|
}
|
|
4168
4170
|
text += `${error.name}: ${error.message}`;
|
|
@@ -5576,7 +5578,7 @@ const startServerUsingCommand = async (
|
|
|
5576
5578
|
if (timeoutAbortSource.signal.aborted) {
|
|
5577
5579
|
// aborted by timeout
|
|
5578
5580
|
throw new Error(
|
|
5579
|
-
`"${webServer.command}" command did not start a server in less than ${allocatedMs}ms`,
|
|
5581
|
+
`"${webServer.command}" command did not start a server at ${webServer.origin} in less than ${allocatedMs}ms`,
|
|
5580
5582
|
);
|
|
5581
5583
|
}
|
|
5582
5584
|
if (signal.aborted) {
|
|
@@ -9208,11 +9210,24 @@ const reportAsJunitXml = async (
|
|
|
9208
9210
|
const testCase = testSuite.createNode("testcase", {
|
|
9209
9211
|
file: fileRelativeUrl,
|
|
9210
9212
|
name: group,
|
|
9211
|
-
|
|
9212
|
-
|
|
9213
|
+
// duration of this execution
|
|
9214
|
+
time: mockFluctuatingValues
|
|
9213
9215
|
? "[mock]"
|
|
9214
|
-
:
|
|
9215
|
-
|
|
9216
|
+
: executionResult.status === "skipped"
|
|
9217
|
+
? 0
|
|
9218
|
+
: executionResult.timings.end,
|
|
9219
|
+
// Date and time of when the test run was executed
|
|
9220
|
+
...(executionResult.status === "skipped"
|
|
9221
|
+
? {}
|
|
9222
|
+
: {
|
|
9223
|
+
timestamp: mockFluctuatingValues
|
|
9224
|
+
? "[mock]"
|
|
9225
|
+
: new Date(executionResult.timings.origin)
|
|
9226
|
+
.toISOString()
|
|
9227
|
+
.slice(0, -5),
|
|
9228
|
+
}),
|
|
9229
|
+
// Total number of tests for this execution
|
|
9230
|
+
tests: 1,
|
|
9216
9231
|
});
|
|
9217
9232
|
testSuite.appendChild(testCase);
|
|
9218
9233
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsenv/test",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"@jsenv/ast": "6.2.16",
|
|
42
42
|
"@jsenv/exception": "1.1.2",
|
|
43
43
|
"@jsenv/filesystem": "4.10.2",
|
|
44
|
-
"@jsenv/github-check-run": "0.
|
|
44
|
+
"@jsenv/github-check-run": "0.2.0",
|
|
45
45
|
"@jsenv/humanize": "1.2.8",
|
|
46
46
|
"@jsenv/plugin-supervisor": "1.5.18",
|
|
47
47
|
"@jsenv/sourcemap": "1.2.23",
|
|
@@ -25,7 +25,6 @@ import {
|
|
|
25
25
|
import { memoryUsage } from "node:process";
|
|
26
26
|
import { takeCoverage } from "node:v8";
|
|
27
27
|
import stripAnsi from "strip-ansi";
|
|
28
|
-
|
|
29
28
|
import { generateCoverage } from "../coverage/generate_coverage.js";
|
|
30
29
|
import { createCallOrderer } from "../helpers/call_orderer.js";
|
|
31
30
|
import { startMeasuringTotalCpuUsage } from "../helpers/cpu_usage.js";
|
|
@@ -25,26 +25,28 @@ export const formatErrorForTerminal = (
|
|
|
25
25
|
error.site.url.startsWith("file:") &&
|
|
26
26
|
typeof error.site.line === "number"
|
|
27
27
|
) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
28
|
+
try {
|
|
29
|
+
const content = readFileSync(new URL(error.site.url), "utf8");
|
|
30
|
+
text += generateContentFrame({
|
|
31
|
+
content,
|
|
32
|
+
line: error.site.line,
|
|
33
|
+
column: error.site.column,
|
|
34
|
+
linesAbove: 2,
|
|
35
|
+
linesBelow: 0,
|
|
36
|
+
lineMaxWidth: process.stdout.columns,
|
|
37
|
+
format: (string, type) => {
|
|
38
|
+
return {
|
|
39
|
+
line_number_aside: () => ANSI.color(string, ANSI.GREY),
|
|
40
|
+
char: () => string,
|
|
41
|
+
marker_overflow_left: () => ANSI.color(string, ANSI.GREY),
|
|
42
|
+
marker_overflow_right: () => ANSI.color(string, ANSI.GREY),
|
|
43
|
+
marker_line: () => ANSI.color(string, ANSI.RED),
|
|
44
|
+
marker_column: () => ANSI.color(string, ANSI.RED),
|
|
45
|
+
}[type]();
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
text += `\n`;
|
|
49
|
+
} catch {}
|
|
48
50
|
}
|
|
49
51
|
}
|
|
50
52
|
text += `${error.name}: ${error.message}`;
|
|
@@ -38,11 +38,24 @@ export const reportAsJunitXml = async (
|
|
|
38
38
|
const testCase = testSuite.createNode("testcase", {
|
|
39
39
|
file: fileRelativeUrl,
|
|
40
40
|
name: group,
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
// duration of this execution
|
|
42
|
+
time: mockFluctuatingValues
|
|
43
43
|
? "[mock]"
|
|
44
|
-
:
|
|
45
|
-
|
|
44
|
+
: executionResult.status === "skipped"
|
|
45
|
+
? 0
|
|
46
|
+
: executionResult.timings.end,
|
|
47
|
+
// Date and time of when the test run was executed
|
|
48
|
+
...(executionResult.status === "skipped"
|
|
49
|
+
? {}
|
|
50
|
+
: {
|
|
51
|
+
timestamp: mockFluctuatingValues
|
|
52
|
+
? "[mock]"
|
|
53
|
+
: new Date(executionResult.timings.origin)
|
|
54
|
+
.toISOString()
|
|
55
|
+
.slice(0, -5),
|
|
56
|
+
}),
|
|
57
|
+
// Total number of tests for this execution
|
|
58
|
+
tests: 1,
|
|
46
59
|
});
|
|
47
60
|
testSuite.appendChild(testCase);
|
|
48
61
|
|
|
@@ -117,7 +117,7 @@ export const startServerUsingCommand = async (
|
|
|
117
117
|
if (timeoutAbortSource.signal.aborted) {
|
|
118
118
|
// aborted by timeout
|
|
119
119
|
throw new Error(
|
|
120
|
-
`"${webServer.command}" command did not start a server in less than ${allocatedMs}ms`,
|
|
120
|
+
`"${webServer.command}" command did not start a server at ${webServer.origin} in less than ${allocatedMs}ms`,
|
|
121
121
|
);
|
|
122
122
|
}
|
|
123
123
|
if (signal.aborted) {
|