Skip to content

Commit

Permalink
fix: coverage reportDir should respect --cwd (#764)
Browse files Browse the repository at this point in the history
when invoked with `nyc --cwd sub-directory`, coverage reports were saved in `./coverage`, shouldn't it be `./sub-directory/coverage`?
  • Loading branch information
jl- authored and bcoe committed Jan 22, 2018
1 parent 6d51456 commit b0d6dae
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ NYC.prototype.report = function () {
var tree
var map = this._getCoverageMapFromAllCoverageFiles()
var context = libReport.createContext({
dir: this._reportDir,
dir: this.reportDirectory(),
watermarks: this.config.watermarks
})

Expand Down Expand Up @@ -537,6 +537,10 @@ NYC.prototype.tempDirectory = function () {
return path.resolve(this.cwd, this._tempDirectory)
}

NYC.prototype.reportDirectory = function () {
return path.resolve(this.cwd, this._reportDir)
}

NYC.prototype.processInfoDirectory = function () {
return path.resolve(this.tempDirectory(), 'processinfo')
}
Expand Down

0 comments on commit b0d6dae

Please sign in to comment.