From 3cb1861a960a5954750c3957b3e14ae148b3cda3 Mon Sep 17 00:00:00 2001 From: Nikita Golov Date: Thu, 7 Mar 2019 21:06:43 +0300 Subject: [PATCH] fix: resolve absolute paths in nyc instrument (#1012) Fixes #1014 --- index.js | 2 +- test/nyc-integration.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 743ef1136..80198b2c3 100755 --- a/index.js +++ b/index.js @@ -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) { diff --git a/test/nyc-integration.js b/test/nyc-integration.js index 7c208230c..9cc5cfe8b 100644 --- a/test/nyc-integration.js +++ b/test/nyc-integration.js @@ -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() }) })