
Security News
ECMAScript 2025 Finalized with Iterator Helpers, Set Methods, RegExp.escape, and More
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Renamed to codacy-coverage
Codacy support for Node.js. Get coverage reporting and code analysis for Node.js from Codacy.
##Installation:
Add the latest version of codacy
to your package.json:
npm install codacy --save
If you're using mocha, add mocha-lcov-reporter
to your package.json:
npm install mocha-lcov-reporter --save
##Usage:
This script ( bin/codacy.js
) can take standard input from any tool that emits the lcov data format (including mocha's LCov reporter) and send it to Codacy to report your code coverage there.
Once your app is instrumented for coverage, and building, you need to pipe the lcov output to ./node_modules/codacy/bin/codacy.js
.
You'll need to provide the Report token from Codacy via an environment variable:
NODE_ENV=test YOURPACKAGE_COVERAGE=1 ./node_modules/.bin/mocha \
--require blanket \
--reporter mocha-lcov-reporter | ./node_modules/codacy/bin/codacy.js
Instrumenting your app for coverage is probably harder than it needs to be (read here), but that's also a necessary step.
In mocha, if you've got your code instrumented for coverage, the command for a travis build would look something like this:
YOURPACKAGE_COVERAGE=1 ./node_modules/.bin/mocha test -R mocha-lcov-reporter | ./node_modules/codacy/bin/codacy.js
With Mocha:
istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && cat ./coverage/lcov.info | ./node_modules/codacy/bin/codacy.js && rm -rf ./coverage
With Jasmine:
istanbul cover jasmine-node --captureExceptions spec/ && cat ./coverage/lcov.info | ./node_modules/codacy/bin/codacy.js && rm -rf ./coverage
Client-side JS code coverage using PhantomJS, Mocha and Blanket:
data-cover
html-attribute./node_modules/.bin/poncho -R lcov test/test.html | ./node_modules/codacy/bin/codacy.js
FAQs
Code Coverage reporter for Codacy.com [DEPRECATED]
The npm package codacy receives a total of 11 weekly downloads. As such, codacy popularity was classified as not popular.
We found that codacy demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Research
North Korean threat actors linked to the Contagious Interview campaign return with 35 new malicious npm packages using a stealthy multi-stage malware loader.