File tree 1 file changed +18
-1
lines changed
1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -44,9 +44,26 @@ function saveCoverage(coverage) {
44
44
*/
45
45
function resolvePaths ( nycFilename ) {
46
46
const nycCoverage = JSON . parse ( readFileSync ( nycFilename , 'utf8' ) )
47
+
48
+ const coverageKeys = Object . keys ( nycCoverage )
49
+ if ( ! coverageKeys . length ) {
50
+ console . error ( '⚠️ file %s has no coverage information' , nycFilename )
51
+ return
52
+ }
53
+ debug ( 'NYC file %s has %d key(s)' , nycFilename , coverageKeys . length )
54
+
47
55
let changed
48
- Object . keys ( nycCoverage ) . forEach ( key => {
56
+ const maxPrintKeys = 3
57
+
58
+ Object . keys ( nycCoverage ) . forEach ( ( key , k ) => {
49
59
const coverage = nycCoverage [ key ]
60
+
61
+ // printing a few found keys and file paths from the coverage file
62
+ // will make debugging any problems much much easier
63
+ if ( k < maxPrintKeys ) {
64
+ debug ( '%d key %s file path %s' , k + 1 , key , coverage . path )
65
+ }
66
+
50
67
if ( coverage . path && ! isAbsolute ( coverage . path ) ) {
51
68
if ( existsSync ( coverage . path ) ) {
52
69
debug ( 'resolving path %s' , coverage . path )
You can’t perform that action at this time.
0 commit comments