@@ -257,11 +257,15 @@ const tasks = {
257
257
const writeFile = join ( nycReportOptions . reportDir , 'specific' , fileName . slice ( fileName . lastIndexOf ( '--' ) + 2 ) . replace ( / \. s p e c \. [ j t ] { 1 } s $ / , '' ) + '.json' )
258
258
259
259
// write every file only once
260
- if ( existsSync ( writeFile ) ) continue ;
260
+ if ( existsSync ( writeFile ) ) {
261
+ console . log ( 'Skipping' , fileName )
262
+ continue ;
263
+ }
261
264
262
265
console . log ( 'Processing ' + fileName )
263
266
264
267
const fullCoverageMap = await nyc . getCoverageMapFromAllCoverageFiles ( join ( nycReportOptions . tempDir , 'specific' , fileName ) )
268
+ writeFileSync ( join ( nycReportOptions . reportDir , 'fullCoverageMap.json' ) , JSON . stringify ( fullCoverageMap ) )
265
269
266
270
mkdirSync ( dirname ( writeFile ) , { recursive : true } )
267
271
// only write items that actually have values, and only write those values
@@ -293,10 +297,10 @@ const tasks = {
293
297
const f = { }
294
298
Object . entries ( mapData . f ) . forEach ( ( [ index , value ] ) => {
295
299
if ( value > 0 ) {
296
- if ( ! mapData . fnMap [ index ] . loc || ! mapData . fnMap [ index ] . loc . start ) {
300
+ if ( ! mapData . fnMap [ index ] . decl || ! mapData . fnMap [ index ] . decl . start ) {
297
301
console . log ( 'not found ' , index , ' in ' , mapData . fnMap )
298
302
}
299
- const lineNr = mapData . fnMap [ index ] . loc . start . line
303
+ const lineNr = mapData . fnMap [ index ] . decl . start . line
300
304
if ( ! f [ lineNr ] ) f [ lineNr ] = [ ]
301
305
f [ lineNr ] . push ( value )
302
306
}
0 commit comments