diff options
| author | Marc Knaup <[email protected]> | 2014-03-14 12:02:02 +0100 |
|---|---|---|
| committer | Marc Knaup <[email protected]> | 2014-03-14 12:02:02 +0100 |
| commit | 913039d9323c94467c853cac985455d5941c454f (patch) | |
| tree | 853de7b1d6366b4212e5ff3144f78c1f470c347b /lib | |
| parent | 0ba53be012ff78282ad39c0863e56fd460005f25 (diff) | |
| download | node-coveralls-913039d9323c94467c853cac985455d5941c454f.tar.xz node-coveralls-913039d9323c94467c853cac985455d5941c454f.zip | |
convertLcovToCoveralls should convert absolute source paths to relative paths in output.
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/convertLcovToCoveralls.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/convertLcovToCoveralls.js b/lib/convertLcovToCoveralls.js index b73863a..11c87b6 100644 --- a/lib/convertLcovToCoveralls.js +++ b/lib/convertLcovToCoveralls.js @@ -13,11 +13,12 @@ var detailsToCoverage = function(length, details){ }; var convertLcovFileObject = function(file, filepath){ - filepath = path.resolve(filepath, file.file); + var rootpath = filepath; + filepath = path.resolve(rootpath, file.file); var source = fs.readFileSync(filepath, 'utf8'); var lines = source.split("\n"); var coverage = detailsToCoverage(lines.length, file.lines.details); - return { name : file.file, + return { name : path.relative(rootpath, path.resolve(rootpath, file.file)), source : source, coverage : coverage }; }; |
