aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJoshua Davis <[email protected]>2016-11-11 10:08:57 -0500
committerJoshua Davis <[email protected]>2016-11-11 10:08:57 -0500
commitacc1fd8315edc64ef5a0cb233143b7b85017fd4c (patch)
tree1953910087b900758905c630e2dcd942727ef79c /test
parentcbb1e46ddddb045b538bc63f834937ac92c34eb2 (diff)
downloadnode-coveralls-acc1fd8315edc64ef5a0cb233143b7b85017fd4c.tar.xz
node-coveralls-acc1fd8315edc64ef5a0cb233143b7b85017fd4c.zip
added sample .lcov and test fixture for Issue #143
Diffstat (limited to 'test')
-rw-r--r--test/convertLcovToCoveralls.js30
1 files changed, 30 insertions, 0 deletions
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();
+ });
+
+ });
+
});