File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -44,9 +44,26 @@ function saveCoverage(coverage) {
4444 */
4545function resolvePaths ( nycFilename ) {
4646 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+
4755 let changed
48- Object . keys ( nycCoverage ) . forEach ( key => {
56+ const maxPrintKeys = 3
57+
58+ Object . keys ( nycCoverage ) . forEach ( ( key , k ) => {
4959 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+
5067 if ( coverage . path && ! isAbsolute ( coverage . path ) ) {
5168 if ( existsSync ( coverage . path ) ) {
5269 debug ( 'resolving path %s' , coverage . path )
You can’t perform that action at this time.
0 commit comments