escover 1.9.0 → 1.10.0
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
CHANGED
package/bin/escover.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import tryCatch from 'try-catch';
|
|
2
1
|
import {
|
|
3
2
|
writeFileSync,
|
|
4
3
|
readFileSync,
|
|
5
4
|
} from 'fs';
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
5
|
+
import tryCatch from 'try-catch';
|
|
6
|
+
import {getFileEntries} from '../c4.js';
|
|
7
|
+
import {transform} from '../transform.js';
|
|
8
|
+
import {merge} from '../merge.js';
|
|
9
|
+
import {findCacheDir} from './find-cache-dir.js';
|
|
10
10
|
|
|
11
11
|
const {
|
|
12
12
|
stringify,
|
package/lib/exit.js
CHANGED
package/lib/formatters/files.js
CHANGED
|
@@ -50,13 +50,13 @@ export default (coverageFile) => {
|
|
|
50
50
|
};
|
|
51
51
|
|
|
52
52
|
export function formatLines(array) {
|
|
53
|
-
console.log(array);
|
|
54
53
|
const lines = array.slice(0, 10).join(', ');
|
|
55
54
|
|
|
56
55
|
if (array.length <= 10)
|
|
57
56
|
return lines;
|
|
58
57
|
|
|
59
|
-
|
|
58
|
+
const latest = array[array.length - 1];
|
|
59
|
+
return `${lines}..${latest}`;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
function parseUncoveredLines(lines) {
|
|
@@ -79,11 +79,12 @@ function parseCoverageFile(coverageFile) {
|
|
|
79
79
|
const uncoveredLines = parseUncoveredLines(lines);
|
|
80
80
|
|
|
81
81
|
const linesCount = keys(lines).length;
|
|
82
|
-
const
|
|
82
|
+
const uncoveredLinesCount = uncoveredLines.length;
|
|
83
|
+
const percentLines = getLinesPercent(linesCount, uncoveredLinesCount);
|
|
83
84
|
|
|
84
85
|
files.push({
|
|
85
86
|
filename,
|
|
86
|
-
covered: !
|
|
87
|
+
covered: !uncoveredLinesCount,
|
|
87
88
|
lines: uncoveredLines,
|
|
88
89
|
percentLines,
|
|
89
90
|
});
|
|
@@ -92,9 +93,9 @@ function parseCoverageFile(coverageFile) {
|
|
|
92
93
|
return files;
|
|
93
94
|
}
|
|
94
95
|
|
|
95
|
-
function
|
|
96
|
+
export function getLinesPercent(linesCount, uncoveredLinesCount) {
|
|
96
97
|
if (!linesCount)
|
|
97
98
|
return 100;
|
|
98
99
|
|
|
99
|
-
return 100 - Math.round(100 / linesCount *
|
|
100
|
+
return 100 - Math.round(100 / linesCount * uncoveredLinesCount);
|
|
100
101
|
}
|