aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorcainus <[email protected]>2013-03-27 23:48:04 -0700
committercainus <[email protected]>2013-03-27 23:48:04 -0700
commit112119e43cb048cfa0dbd98d6e03833b8ca4b619 (patch)
tree1bdb90068b87229dfa04a7a217e907d856ed0981 /test
parent86f733351d4e920a44e9682f105034628f6b0b4d (diff)
downloadnode-coveralls-112119e43cb048cfa0dbd98d6e03833b8ca4b619.tar.xz
node-coveralls-112119e43cb048cfa0dbd98d6e03833b8ca4b619.zip
changed to use lcov input format only.
Diffstat (limited to 'test')
-rw-r--r--test/convertLcovToCoveralls.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/convertLcovToCoveralls.js b/test/convertLcovToCoveralls.js
new file mode 100644
index 0000000..df8c5cf
--- /dev/null
+++ b/test/convertLcovToCoveralls.js
@@ -0,0 +1,27 @@
+var convertLcovToCoveralls = require('../lib/convertLcovToCoveralls');
+var should = require('should');
+var fs = require('fs');
+
+describe("convertLcovToCoveralls", function(){
+ it ("should convert a simple lcov file", function(){
+ process.env.TRAVIS_JOB_ID = -1;
+ var path = __dirname + "/../fixtures/onefile.lcov";
+ var input = fs.readFileSync(path, "utf8");
+ var libpath = __dirname + "/../fixtures/lib";
+ var output = convertLcovToCoveralls(input, libpath);
+ output.source_files[0].name.should.equal("index.js");
+ output.source_files[0].source.split("\n").length.should.equal(225);
+ output.source_files[0].coverage[55].should.equal(0);
+ output.source_files[0].coverage[61].should.equal(0);
+ });
+
+ it ("should work with a relative path as well", function(){
+ process.env.TRAVIS_JOB_ID = -1;
+ var path = __dirname + "/../fixtures/onefile.lcov";
+ var input = fs.readFileSync(path, "utf8");
+ var libpath = "fixtures/lib";
+ var output = convertLcovToCoveralls(input, libpath);
+ output.source_files[0].name.should.equal("index.js");
+ output.source_files[0].source.split("\n").length.should.equal(225);
+ });
+});