Skip to content

Commit

Permalink
fix: resolve absolute paths in nyc instrument (#1012)
Browse files Browse the repository at this point in the history
Fixes #1014
  • Loading branch information
golonikum authored and coreyfarrell committed Mar 7, 2019
1 parent a161d23 commit 3cb1861
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ NYC.prototype.instrumentAllFiles = function (input, output, cb) {
}

if (transform) {
code = transform(code, { filename: filename, relFile: inFile })
code = transform(code, { filename: inFile, relFile: inFile })
}

if (!output) {
Expand Down
2 changes: 1 addition & 1 deletion test/nyc-integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ describe('the nyc cli', function () {

proc.on('close', function (code) {
code.should.equal(0)
stdout.should.match(/path:"\.\/half-covered\.js"/)
stdout.should.contain(`path:${JSON.stringify(path.resolve(fixturesCLI, 'half-covered.js'))}`)
done()
})
})
Expand Down

0 comments on commit 3cb1861

Please sign in to comment.