[Pkg-javascript-commits] [node-coveralls] 280/332: added sample .lcov and test fixture for Issue #143

Bastien Roucariès rouca at moszumanska.debian.org
Thu Nov 9 13:54:11 UTC 2017


This is an automated email from the git hooks/post-receive script.

rouca pushed a commit to branch master
in repository node-coveralls.

commit acc1fd8315edc64ef5a0cb233143b7b85017fd4c
Author: Joshua Davis <josdavis at microsoft.com>
Date:   Fri Nov 11 10:08:57 2016 -0500

    added sample .lcov and test fixture for Issue #143
---
 fixtures/istanbul.remap.lcov   | 131 +++++++++++++++++++++++++++++++++++++++++
 test/convertLcovToCoveralls.js |  30 ++++++++++
 2 files changed, 161 insertions(+)

diff --git a/fixtures/istanbul.remap.lcov b/fixtures/istanbul.remap.lcov
new file mode 100644
index 0000000..8da5f83
--- /dev/null
+++ b/fixtures/istanbul.remap.lcov
@@ -0,0 +1,131 @@
+TN:
+SF:/Users/deepsweet/Dropbox/projects/svgo/node_modules/angular2-template-loader/index.js!/Users/deepsweet/Dropbox/projects/svgo/node_modules/tslint-loader/index.js!/Users/deepsweet/Dropbox/projects/svgo/lib/svgo/config.js
+FN:14,(anonymous_1)
+FN:51,preparePluginsArray
+FN:56,(anonymous_3)
+FN:101,extendConfig
+FN:108,(anonymous_5)
+FN:115,(anonymous_6)
+FN:161,optimizePluginsArray
+FN:165,(anonymous_8)
+FN:169,(anonymous_9)
+FNF:9
+FNH:9
+FNDA:87,(anonymous_1)
+FNDA:87,preparePluginsArray
+FNDA:141,(anonymous_3)
+FNDA:1,extendConfig
+FNDA:3,(anonymous_5)
+FNDA:84,(anonymous_6)
+FNDA:87,optimizePluginsArray
+FNDA:141,(anonymous_8)
+FNDA:141,(anonymous_9)
+DA:1,1
+DA:3,1
+DA:5,1
+DA:14,1
+DA:16,87
+DA:18,87
+DA:20,85
+DA:22,85
+DA:23,85
+DA:24,85
+DA:29,2
+DA:31,2
+DA:33,2
+DA:34,1
+DA:37,2
+DA:41,87
+DA:51,1
+DA:53,87
+DA:56,87
+DA:59,141
+DA:61,85
+DA:62,85
+DA:65,85
+DA:66,0
+DA:67,0
+DA:70,85
+DA:71,0
+DA:74,85
+DA:75,85
+DA:78,85
+DA:83,56
+DA:84,56
+DA:88,141
+DA:101,1
+DA:103,1
+DA:106,1
+DA:108,1
+DA:111,3
+DA:113,3
+DA:115,3
+DA:117,84
+DA:119,3
+DA:120,2
+DA:121,2
+DA:124,1
+DA:125,1
+DA:128,0
+DA:129,0
+DA:142,1
+DA:143,0
+DA:147,1
+DA:148,0
+DA:151,1
+DA:161,1
+DA:163,87
+DA:165,87
+DA:166,141
+DA:169,87
+DA:171,141
+DA:172,44
+DA:173,44
+DA:176,97
+DA:178,97
+DA:182,87
+LF:64
+LH:57
+BRDA:18,1,0,85
+BRDA:18,1,1,2
+BRDA:18,2,0,87
+BRDA:18,2,1,86
+BRDA:22,3,0,85
+BRDA:22,3,1,0
+BRDA:33,4,0,1
+BRDA:33,4,1,1
+BRDA:59,5,0,85
+BRDA:59,5,1,56
+BRDA:65,6,0,0
+BRDA:65,6,1,85
+BRDA:66,7,0,0
+BRDA:66,7,1,0
+BRDA:70,8,0,0
+BRDA:70,8,1,85
+BRDA:74,9,0,85
+BRDA:74,9,1,0
+BRDA:106,10,0,1
+BRDA:106,10,1,0
+BRDA:111,11,0,3
+BRDA:111,11,1,0
+BRDA:117,12,0,3
+BRDA:117,12,1,81
+BRDA:119,13,0,2
+BRDA:119,13,1,1
+BRDA:120,14,0,2
+BRDA:120,14,1,1
+BRDA:124,15,0,1
+BRDA:124,15,1,0
+BRDA:128,16,0,0
+BRDA:128,16,1,0
+BRDA:142,17,0,0
+BRDA:142,17,1,1
+BRDA:147,18,0,0
+BRDA:147,18,1,1
+BRDA:171,19,0,44
+BRDA:171,19,1,97
+BRDA:171,20,0,141
+BRDA:171,20,1,54
+BRF:40
+BRH:27
+end_of_record
diff --git a/test/convertLcovToCoveralls.js b/test/convertLcovToCoveralls.js
index b927f05..7e67f3d 100644
--- a/test/convertLcovToCoveralls.js
+++ b/test/convertLcovToCoveralls.js
@@ -117,4 +117,34 @@ describe("convertLcovToCoveralls", function(){
     });
   });
 
+  it ("should parse file paths concatenated by typescript and ng 2", function(done) {
+    process.env.TRAVIS_JOB_ID = -1;
+    var lcovpath = __dirname + "/../fixtures/istanbul.remap.lcov";
+    var input = fs.readFileSync(lcovpath, "utf8");
+    var libpath = "/Users/deepsweet/Dropbox/projects/svgo/lib";
+    var sourcepath = path.resolve(libpath, "svgo/config.js");
+
+    var originalReadFileSync = fs.readFileSync;
+    fs.readFileSync = function(filepath) {
+      if (filepath === sourcepath) {
+        return '';
+      }
+
+      return originalReadFileSync.apply(fs, arguments);
+    };
+
+    var originalExistsSync = fs.existsSync;
+    fs.existsSync = function () { return false; };
+
+    convertLcovToCoveralls(input, {filepath: libpath}, function(err, output){
+      fs.readFileSync = originalReadFileSync;
+      fs.existsSync = originalExistsSync;
+
+      should.not.exist(err);
+      output.source_files.should.be.empty();
+      done();
+    });
+
+  });
+
 });

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-coveralls.git



More information about the Pkg-javascript-commits mailing list