Skip to content

Commit 3cb1861

Browse files
golonikumcoreyfarrell
authored andcommitted
fix: resolve absolute paths in nyc instrument (#1012)
Fixes #1014
1 parent a161d23 commit 3cb1861

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ NYC.prototype.instrumentAllFiles = function (input, output, cb) {
212212
}
213213

214214
if (transform) {
215-
code = transform(code, { filename: filename, relFile: inFile })
215+
code = transform(code, { filename: inFile, relFile: inFile })
216216
}
217217

218218
if (!output) {

test/nyc-integration.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ describe('the nyc cli', function () {
480480

481481
proc.on('close', function (code) {
482482
code.should.equal(0)
483-
stdout.should.match(/path:"\.\/half-covered\.js"/)
483+
stdout.should.contain(`path:${JSON.stringify(path.resolve(fixturesCLI, 'half-covered.js'))}`)
484484
done()
485485
})
486486
})

0 commit comments

Comments
 (0)