escover 3.5.0 → 3.5.2
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 +11 -0
- package/lib/cli/cli.js +6 -3
- package/lib/escover.js +5 -15
- package/package.json +3 -3
package/ChangeLog
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
2023.08.04, v3.5.2
|
|
2
|
+
|
|
3
|
+
feature:
|
|
4
|
+
- 95cc7a5 package: eslint-plugin-putout v19.0.0
|
|
5
|
+
- a2d2857 package: putout v31.0.0
|
|
6
|
+
|
|
7
|
+
2023.07.31, v3.5.1
|
|
8
|
+
|
|
9
|
+
fix:
|
|
10
|
+
- ba6e405 escover: write coverage on exit -> write coverage each time
|
|
11
|
+
|
|
1
12
|
2023.07.31, v3.5.0
|
|
2
13
|
|
|
3
14
|
fix:
|
package/lib/cli/cli.js
CHANGED
|
@@ -5,6 +5,8 @@ import {version} from './version.js';
|
|
|
5
5
|
import reportLines from '../formatters/lines.js';
|
|
6
6
|
import reportFiles from '../formatters/files.js';
|
|
7
7
|
|
|
8
|
+
const noop = () => {};
|
|
9
|
+
|
|
8
10
|
const {ESCOVER_FORMAT} = process.env;
|
|
9
11
|
|
|
10
12
|
export const ESCOVER_NODE_OPTIONS = '--no-warnings --loader zenload';
|
|
@@ -30,7 +32,7 @@ export const cli = ({argv, exit, readCoverage}) => {
|
|
|
30
32
|
const cmd = argv.slice(2);
|
|
31
33
|
|
|
32
34
|
if (cmd.length) {
|
|
33
|
-
execute(`"${cmd.join('" "')}"`,
|
|
35
|
+
execute(`"${cmd.join('" "')}"`, noop);
|
|
34
36
|
}
|
|
35
37
|
|
|
36
38
|
const coverage = readCoverage();
|
|
@@ -45,7 +47,7 @@ export const cli = ({argv, exit, readCoverage}) => {
|
|
|
45
47
|
process.stdout.write(output);
|
|
46
48
|
};
|
|
47
49
|
|
|
48
|
-
export const isSuccess = (error) => error?.status === Number(process.env.ESCOVER_SUCCESS_EXIT_CODE);
|
|
50
|
+
export const isSuccess = (error) => !error || error?.status === Number(process.env.ESCOVER_SUCCESS_EXIT_CODE);
|
|
49
51
|
|
|
50
52
|
function execute(cmd, exit) {
|
|
51
53
|
const [error] = tryCatch(execSync, cmd, {
|
|
@@ -57,8 +59,9 @@ function execute(cmd, exit) {
|
|
|
57
59
|
},
|
|
58
60
|
});
|
|
59
61
|
|
|
60
|
-
if (isSuccess(error))
|
|
62
|
+
if (isSuccess(error)) {
|
|
61
63
|
return exit(0);
|
|
64
|
+
}
|
|
62
65
|
|
|
63
66
|
if (error) {
|
|
64
67
|
console.error(error.message);
|
package/lib/escover.js
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import process from 'process';
|
|
2
2
|
import montag from 'montag';
|
|
3
3
|
import {instrument} from './instrument/index.js';
|
|
4
|
-
import {exit} from './exit.js';
|
|
5
4
|
import {createFileEntry} from './c4.js';
|
|
6
5
|
import {
|
|
7
6
|
readConfig,
|
|
8
7
|
isExclude,
|
|
9
8
|
} from './config.js';
|
|
10
|
-
|
|
11
|
-
process.once('exit', exit);
|
|
9
|
+
import {writeCoverage} from './coverage-file/coverage-file.js';
|
|
12
10
|
|
|
13
11
|
global.__createC4 = createFileEntry;
|
|
14
12
|
|
|
@@ -38,16 +36,15 @@ export function globalPreload({port}) {
|
|
|
38
36
|
if (loader !== 'escover')
|
|
39
37
|
return;
|
|
40
38
|
|
|
41
|
-
if (type === 'exit')
|
|
42
|
-
return exit();
|
|
43
|
-
|
|
44
39
|
const c4 = createFileEntry(url);
|
|
45
40
|
|
|
46
41
|
if (type === 'set')
|
|
47
|
-
|
|
42
|
+
c4['🧨'](line, column);
|
|
48
43
|
|
|
49
44
|
if (type === 'init')
|
|
50
|
-
|
|
45
|
+
c4.init(line, column);
|
|
46
|
+
|
|
47
|
+
writeCoverage();
|
|
51
48
|
};
|
|
52
49
|
|
|
53
50
|
return `(${escover})();`;
|
|
@@ -56,13 +53,6 @@ export function globalPreload({port}) {
|
|
|
56
53
|
function escover() {
|
|
57
54
|
const loader = 'escover';
|
|
58
55
|
|
|
59
|
-
process.on('exit', () => {
|
|
60
|
-
port.postMessage({
|
|
61
|
-
type: 'exit',
|
|
62
|
-
loader: 'escover',
|
|
63
|
-
});
|
|
64
|
-
});
|
|
65
|
-
|
|
66
56
|
global.__createC4 = (url) => ({
|
|
67
57
|
'🧨': (line, column) => {
|
|
68
58
|
port.postMessage({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "escover",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.2",
|
|
4
4
|
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
|
|
5
5
|
"description": "Coverage for EcmaScript Modules",
|
|
6
6
|
"main": "lib/escover.js",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"montag": "^1.2.1",
|
|
48
48
|
"once": "^1.4.0",
|
|
49
49
|
"picomatch": "^2.3.1",
|
|
50
|
-
"putout": "^
|
|
50
|
+
"putout": "^31.0.0",
|
|
51
51
|
"strip-ansi": "^7.0.1",
|
|
52
52
|
"table": "^6.8.0",
|
|
53
53
|
"try-catch": "^3.0.0",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"escover": "^3.2.0",
|
|
65
65
|
"eslint": "^8.3.0",
|
|
66
66
|
"eslint-plugin-n": "^16.0.0",
|
|
67
|
-
"eslint-plugin-putout": "^
|
|
67
|
+
"eslint-plugin-putout": "^19.0.0",
|
|
68
68
|
"madrun": "^9.0.0",
|
|
69
69
|
"supertape": "^8.0.1"
|
|
70
70
|
}
|