@jsenv/test 3.4.2 → 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.
@@ -4143,26 +4143,28 @@ const formatErrorForTerminal = (
4143
4143
  error.site.url.startsWith("file:") &&
4144
4144
  typeof error.site.line === "number"
4145
4145
  ) {
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`;
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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/test",
3
- "version": "3.4.2",
3
+ "version": "3.4.3",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -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) {