aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJoshua Davis <[email protected]>2016-11-11 07:53:36 -0800
committerJoshua Davis <[email protected]>2016-11-11 07:53:36 -0800
commitf9c36973d799da13faa4adaf48a8ddee6b711927 (patch)
tree5ee52a82b2f3f4768cb215348b66072c0a9e3c54 /lib
parentacc1fd8315edc64ef5a0cb233143b7b85017fd4c (diff)
downloadnode-coveralls-f9c36973d799da13faa4adaf48a8ddee6b711927.tar.xz
node-coveralls-f9c36973d799da13faa4adaf48a8ddee6b711927.zip
implemented code to parse concatenated file paths (fixes #143)
Diffstat (limited to 'lib')
-rw-r--r--lib/convertLcovToCoveralls.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/convertLcovToCoveralls.js b/lib/convertLcovToCoveralls.js
index e925343..68687bd 100644
--- a/lib/convertLcovToCoveralls.js
+++ b/lib/convertLcovToCoveralls.js
@@ -23,6 +23,16 @@ var convertLcovFileObject = function(file, filepath){
coverage : coverage };
};
+var cleanFilePath = function(file) {
+ if (file.indexOf('!') > -1) {
+ var regex = /^(.*!)(.*)$/g;
+ var matches = regex.exec(file);
+ return matches[matches.length-1];
+ }
+
+ return file;
+};
+
var convertLcovToCoveralls = function(input, options, cb){
var filepath = options.filepath || '';
logger.debug("in: ", filepath);
@@ -61,6 +71,7 @@ var convertLcovToCoveralls = function(input, options, cb){
postJson.service_pull_request = options.service_pull_request;
}
parsed.forEach(function(file){
+ file.file = cleanFilePath(file.file);
var currentFilePath = path.resolve(filepath, file.file);
if (fs.existsSync(currentFilePath)) {
postJson.source_files.push(convertLcovFileObject(file, filepath));