Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Combining code coverage reports in javascript for coveralls

I have node.js based projects that also include client side code. I have 2 separate unit test suites, 1 for front end and 1 for back end. I currently have mocha running using blanket for code coverage and piping the result into the coveralls module like so:

mocha --require blanket --reporter mocha-lcov-reporter server/test/unit | ./node_modules/.bin/coveralls

I essentially need to combine the output of these 2 test runs (server and client):

mocha --require blanket --reporter mocha-lcov-reporter server/test/unit

and

mocha --require blanket --reporter mocha-lcov-reporter client/test/unit

and pipe that into the coveralls module.

Is this possible? How would I do this?

like image 932
Richard Walker Avatar asked Feb 09 '14 12:02

Richard Walker


People also ask

What is coveralls coverage?

Anais Urlichs · Dec 22, 2020. Coveralls is a web service that allows users to track the code coverage of their application over time in order to optimize the effectiveness of their unit tests.

What is code coverage JavaScript?

Code coverage is a software-testing metric that determines how many lines of code have successfully validated under a test suite, and is usually measured with specialized tools like Codecov.

What is coveralls io?

Coveralls is a web service to help you track your code coverage over time, and ensure that all your new code is fully covered.

What is code coverage percentage?

Code Coverage Percentage = (Number of lines of code executed by a testing algorithm/Total number of lines of code in a system component) * 100.


1 Answers

I used gulp and a coveralls plugin to accomplish this:

http://gulpjs.com/

https://www.npmjs.org/package/gulp-coveralls

like image 104
pgoldrbx Avatar answered Sep 30 '22 16:09

pgoldrbx