escover 6.1.0 → 6.1.1
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 +5 -0
- package/lib/cli/cli.js +12 -3
- package/package.json +1 -1
package/ChangeLog
CHANGED
package/lib/cli/cli.js
CHANGED
|
@@ -6,11 +6,18 @@ import {version} from './version.js';
|
|
|
6
6
|
import reportLines from '../formatters/lines.js';
|
|
7
7
|
import reportFiles from '../formatters/files.js';
|
|
8
8
|
|
|
9
|
+
const {env} = process;
|
|
10
|
+
|
|
9
11
|
const noop = () => {};
|
|
10
12
|
|
|
11
|
-
const {ESCOVER_FORMAT} =
|
|
13
|
+
const {NODE_OPTIONS, ESCOVER_FORMAT} = env;
|
|
12
14
|
|
|
13
|
-
export const
|
|
15
|
+
export const createNodeOptions = (options = NODE_OPTIONS) => {
|
|
16
|
+
if (!options.includes('escover/register'))
|
|
17
|
+
return `--import escover/register ${options}`;
|
|
18
|
+
|
|
19
|
+
return options;
|
|
20
|
+
};
|
|
14
21
|
|
|
15
22
|
export const cli = ({argv, exit, readCoverage}) => {
|
|
16
23
|
const args = yargsParser(argv.slice(2), {
|
|
@@ -50,11 +57,12 @@ export const cli = ({argv, exit, readCoverage}) => {
|
|
|
50
57
|
export const isSuccess = (error) => !error || error?.status === Number(process.env.ESCOVER_SUCCESS_EXIT_CODE);
|
|
51
58
|
|
|
52
59
|
function execute(cmd, exit) {
|
|
60
|
+
console.log(createNodeOptions());
|
|
53
61
|
const [error] = tryCatch(execSync, cmd, {
|
|
54
62
|
stdio: [0, 1, 2],
|
|
55
63
|
env: {
|
|
56
64
|
...process.env,
|
|
57
|
-
NODE_OPTIONS:
|
|
65
|
+
NODE_OPTIONS: createNodeOptions(),
|
|
58
66
|
},
|
|
59
67
|
});
|
|
60
68
|
|
|
@@ -66,3 +74,4 @@ function execute(cmd, exit) {
|
|
|
66
74
|
return exit(1);
|
|
67
75
|
}
|
|
68
76
|
}
|
|
77
|
+
|