@jsenv/test 3.4.2 → 3.4.4

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.
@@ -1583,15 +1583,13 @@ const createDynamicLog = ({
1583
1583
  // is that node.js will later throw error if stream gets closed
1584
1584
  // while something listening data on it
1585
1585
  const spyStreamOutput = (stream, callback) => {
1586
- const originalWrite = stream.write;
1587
-
1588
1586
  let output = "";
1589
1587
  let installed = true;
1590
-
1588
+ const originalWrite = stream.write;
1591
1589
  stream.write = function (...args /* chunk, encoding, callback */) {
1592
1590
  output += args;
1593
1591
  callback(output);
1594
- return originalWrite.call(stream, ...args);
1592
+ return originalWrite.call(this, ...args);
1595
1593
  };
1596
1594
 
1597
1595
  const uninstall = () => {
@@ -4143,26 +4141,28 @@ const formatErrorForTerminal = (
4143
4141
  error.site.url.startsWith("file:") &&
4144
4142
  typeof error.site.line === "number"
4145
4143
  ) {
4146
- const content = readFileSync(new URL(error.site.url), "utf8");
4147
- text += generateContentFrame({
4148
- content,
4149
- line: error.site.line,
4150
- column: error.site.column,
4151
- linesAbove: 2,
4152
- linesBelow: 0,
4153
- lineMaxWidth: process.stdout.columns,
4154
- format: (string, type) => {
4155
- return {
4156
- line_number_aside: () => ANSI.color(string, ANSI.GREY),
4157
- char: () => string,
4158
- marker_overflow_left: () => ANSI.color(string, ANSI.GREY),
4159
- marker_overflow_right: () => ANSI.color(string, ANSI.GREY),
4160
- marker_line: () => ANSI.color(string, ANSI.RED),
4161
- marker_column: () => ANSI.color(string, ANSI.RED),
4162
- }[type]();
4163
- },
4164
- });
4165
- text += `\n`;
4144
+ try {
4145
+ const content = readFileSync(new URL(error.site.url), "utf8");
4146
+ text += generateContentFrame({
4147
+ content,
4148
+ line: error.site.line,
4149
+ column: error.site.column,
4150
+ linesAbove: 2,
4151
+ linesBelow: 0,
4152
+ lineMaxWidth: process.stdout.columns,
4153
+ format: (string, type) => {
4154
+ return {
4155
+ line_number_aside: () => ANSI.color(string, ANSI.GREY),
4156
+ char: () => string,
4157
+ marker_overflow_left: () => ANSI.color(string, ANSI.GREY),
4158
+ marker_overflow_right: () => ANSI.color(string, ANSI.GREY),
4159
+ marker_line: () => ANSI.color(string, ANSI.RED),
4160
+ marker_column: () => ANSI.color(string, ANSI.RED),
4161
+ }[type]();
4162
+ },
4163
+ });
4164
+ text += `\n`;
4165
+ } catch {}
4166
4166
  }
4167
4167
  }
4168
4168
  text += `${error.name}: ${error.message}`;
@@ -5576,7 +5576,7 @@ const startServerUsingCommand = async (
5576
5576
  if (timeoutAbortSource.signal.aborted) {
5577
5577
  // aborted by timeout
5578
5578
  throw new Error(
5579
- `"${webServer.command}" command did not start a server in less than ${allocatedMs}ms`,
5579
+ `"${webServer.command}" command did not start a server at ${webServer.origin} in less than ${allocatedMs}ms`,
5580
5580
  );
5581
5581
  }
5582
5582
  if (signal.aborted) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/test",
3
- "version": "3.4.2",
3
+ "version": "3.4.4",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -38,12 +38,12 @@
38
38
  "dependencies": {
39
39
  "@c88/v8-coverage": "0.1.1",
40
40
  "@jsenv/abort": "4.3.0",
41
- "@jsenv/ast": "6.2.16",
41
+ "@jsenv/ast": "6.2.17",
42
42
  "@jsenv/exception": "1.1.2",
43
43
  "@jsenv/filesystem": "4.10.2",
44
44
  "@jsenv/github-check-run": "0.2.0",
45
45
  "@jsenv/humanize": "1.2.8",
46
- "@jsenv/plugin-supervisor": "1.5.18",
46
+ "@jsenv/plugin-supervisor": "1.5.19",
47
47
  "@jsenv/sourcemap": "1.2.23",
48
48
  "@jsenv/url-meta": "8.5.1",
49
49
  "@jsenv/urls": "2.5.2",
@@ -25,26 +25,28 @@ export const formatErrorForTerminal = (
25
25
  error.site.url.startsWith("file:") &&
26
26
  typeof error.site.line === "number"
27
27
  ) {
28
- const content = readFileSync(new URL(error.site.url), "utf8");
29
- text += generateContentFrame({
30
- content,
31
- line: error.site.line,
32
- column: error.site.column,
33
- linesAbove: 2,
34
- linesBelow: 0,
35
- lineMaxWidth: process.stdout.columns,
36
- format: (string, type) => {
37
- return {
38
- line_number_aside: () => ANSI.color(string, ANSI.GREY),
39
- char: () => string,
40
- marker_overflow_left: () => ANSI.color(string, ANSI.GREY),
41
- marker_overflow_right: () => ANSI.color(string, ANSI.GREY),
42
- marker_line: () => ANSI.color(string, ANSI.RED),
43
- marker_column: () => ANSI.color(string, ANSI.RED),
44
- }[type]();
45
- },
46
- });
47
- text += `\n`;
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}`;
@@ -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) {