@jsenv/test 3.0.17 → 3.0.19

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.
@@ -845,7 +845,9 @@ const createException = (reason, { rootDirectoryUrl } = {}) => {
845
845
  }
846
846
  reason.stackTrace = stackTrace;
847
847
  let stack = "";
848
- const name = reason.name || "Error";
848
+ const name = reason.constructor
849
+ ? reason.constructor.name
850
+ : reason.name || "Error";
849
851
  const message = reason.message || "";
850
852
  stack += `${name}: ${message}`;
851
853
  if (stackTrace) {
@@ -876,7 +878,7 @@ const createException = (reason, { rootDirectoryUrl } = {}) => {
876
878
  if (isError) {
877
879
  // getOwnPropertyNames is not enough to copy .name and .message
878
880
  // on error instances
879
- exception.name = reason.name;
881
+ exception.name = reason.constructor ? reason.constructor.name : reason.name;
880
882
  exception.message = reason.message;
881
883
  }
882
884
  return exception;
@@ -766,11 +766,7 @@ const ANSI = createAnsi({
766
766
  processSupportsBasicColor ||
767
767
  // GitHub workflow does support ANSI but "supports-color" returns false
768
768
  // because stream.isTTY returns false, see https://github.com/actions/runner/issues/241
769
- (process.env.GITHUB_WORKFLOW &&
770
- // Check on FORCE_COLOR is to ensure it is prio over GitHub workflow check
771
- // in unit test we use process.env.FORCE_COLOR = 'false' to fake
772
- // that colors are not supported. Let it have priority
773
- process.env.FORCE_COLOR !== "false"),
769
+ process.env.GITHUB_WORKFLOW,
774
770
  });
775
771
 
776
772
  function isUnicodeSupported() {
@@ -7813,7 +7809,11 @@ const nodeChildProcess = ({
7813
7809
  env = {
7814
7810
  ...env,
7815
7811
  JSENV: true,
7816
- FORCE_COLOR: supportsColor.stdout,
7812
+ FORCE_COLOR:
7813
+ supportsColor.stdout ||
7814
+ // GitHub workflow does support ANSI but "supports-color" returns false
7815
+ // because stream.isTTY returns false, see https://github.com/actions/runner/issues/241
7816
+ process.env.GITHUB_WORKFLOW,
7817
7817
  };
7818
7818
 
7819
7819
  return {
@@ -8288,7 +8288,11 @@ const nodeWorkerThread = ({
8288
8288
  env = {
8289
8289
  ...env,
8290
8290
  JSENV: true,
8291
- FORCE_COLOR: supportsColor.stdout,
8291
+ FORCE_COLOR:
8292
+ supportsColor.stdout ||
8293
+ // GitHub workflow does support ANSI but "supports-color" returns false
8294
+ // because stream.isTTY returns false, see https://github.com/actions/runner/issues/241
8295
+ process.env.GITHUB_WORKFLOW,
8292
8296
  };
8293
8297
 
8294
8298
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/test",
3
- "version": "3.0.17",
3
+ "version": "3.0.19",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -38,13 +38,13 @@
38
38
  "dependencies": {
39
39
  "@c88/v8-coverage": "0.1.1",
40
40
  "@jsenv/abort": "4.3.0",
41
- "@jsenv/ast": "6.0.5",
42
- "@jsenv/filesystem": "4.6.7",
43
- "@jsenv/github-check-run": "0.1.12",
44
- "@jsenv/humanize": "1.1.1",
45
- "@jsenv/plugin-supervisor": "1.4.5",
41
+ "@jsenv/ast": "6.0.6",
42
+ "@jsenv/filesystem": "4.6.8",
43
+ "@jsenv/github-check-run": "0.1.13",
44
+ "@jsenv/humanize": "1.1.2",
45
+ "@jsenv/plugin-supervisor": "1.4.7",
46
46
  "@jsenv/url-meta": "8.4.0",
47
- "@jsenv/urls": "2.2.5",
47
+ "@jsenv/urls": "2.2.6",
48
48
  "@jsenv/utils": "2.1.1",
49
49
  "istanbul-lib-coverage": "3.2.2",
50
50
  "istanbul-lib-instrument": "6.0.3",
@@ -159,7 +159,9 @@ export const createException = (reason, { rootDirectoryUrl } = {}) => {
159
159
  }
160
160
  reason.stackTrace = stackTrace;
161
161
  let stack = "";
162
- const name = reason.name || "Error";
162
+ const name = reason.constructor
163
+ ? reason.constructor.name
164
+ : reason.name || "Error";
163
165
  const message = reason.message || "";
164
166
  stack += `${name}: ${message}`;
165
167
  if (stackTrace) {
@@ -190,7 +192,7 @@ export const createException = (reason, { rootDirectoryUrl } = {}) => {
190
192
  if (isError) {
191
193
  // getOwnPropertyNames is not enough to copy .name and .message
192
194
  // on error instances
193
- exception.name = reason.name;
195
+ exception.name = reason.constructor ? reason.constructor.name : reason.name;
194
196
  exception.message = reason.message;
195
197
  }
196
198
  return exception;
@@ -37,7 +37,11 @@ export const nodeChildProcess = ({
37
37
  env = {
38
38
  ...env,
39
39
  JSENV: true,
40
- FORCE_COLOR: supportsColor.stdout,
40
+ FORCE_COLOR:
41
+ supportsColor.stdout ||
42
+ // GitHub workflow does support ANSI but "supports-color" returns false
43
+ // because stream.isTTY returns false, see https://github.com/actions/runner/issues/241
44
+ process.env.GITHUB_WORKFLOW,
41
45
  };
42
46
 
43
47
  return {
@@ -33,7 +33,11 @@ export const nodeWorkerThread = ({
33
33
  env = {
34
34
  ...env,
35
35
  JSENV: true,
36
- FORCE_COLOR: supportsColor.stdout,
36
+ FORCE_COLOR:
37
+ supportsColor.stdout ||
38
+ // GitHub workflow does support ANSI but "supports-color" returns false
39
+ // because stream.isTTY returns false, see https://github.com/actions/runner/issues/241
40
+ process.env.GITHUB_WORKFLOW,
37
41
  };
38
42
 
39
43
  return {