@@ -8,15 +8,16 @@ const { fixSourcePathes } = require('./utils')
8
8
const debug = require ( 'debug' ) ( 'code-coverage' )
9
9
10
10
// these are standard folder and file names used by NYC tools
11
+ const processWorkingDirectory = process . cwd ( )
11
12
const outputFolder = '.nyc_output'
12
- const coverageFolder = join ( process . cwd ( ) , outputFolder )
13
+ const coverageFolder = join ( processWorkingDirectory , outputFolder )
13
14
const nycFilename = join ( coverageFolder , 'out.json' )
14
15
15
16
// there might be custom "nyc" options in the user package.json
16
17
// see https://github.com/istanbuljs/nyc#configuring-nyc
17
18
// potentially there might be "nyc" options in other configuration files
18
19
// it allows, but for now ignore those options
19
- const pkgFilename = join ( process . cwd ( ) , 'package.json' )
20
+ const pkgFilename = join ( processWorkingDirectory , 'package.json' )
20
21
const pkg = fs . existsSync ( pkgFilename )
21
22
? JSON . parse ( fs . readFileSync ( pkgFilename , 'utf8' ) )
22
23
: { }
@@ -93,7 +94,13 @@ module.exports = {
93
94
94
95
// should we generate report via NYC module API?
95
96
const command = 'nyc'
96
- const args = [ 'report' , '--report-dir' , reportDir ] . concat ( reporters )
97
+ const args = [
98
+ 'report' ,
99
+ '--report-dir' ,
100
+ reportDir ,
101
+ '--temp-dir' ,
102
+ processWorkingDirectory
103
+ ] . concat ( reporters )
97
104
debug (
98
105
'saving coverage report using command: "%s %s"' ,
99
106
command ,
0 commit comments