Socket
Socket
Sign inDemoInstall

codecov

Package Overview
Dependencies
49
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    codecov

Uploading report to Codecov: https://codecov.io


Version published
Weekly downloads
398K
decreased by-9.11%
Maintainers
1
Install size
2.67 MB
Created
Weekly downloads
 

Package description

What is codecov?

The codecov npm package is a tool for uploading code coverage reports to Codecov, a service that provides hosted coverage reports with detailed insights and visualizations. It integrates with various CI/CD pipelines to automate the process of collecting and uploading coverage data.

What are codecov's main functionalities?

Upload Coverage Reports

This feature allows you to upload your code coverage reports to Codecov. You need to provide your Codecov token and the path to the coverage report file.

const codecov = require('codecov');
codecov.upload({ token: 'your-codecov-token', file: 'path/to/coverage.xml' });

CI/CD Integration

This feature demonstrates how to integrate Codecov with your CI/CD pipeline. It uses environment variables to dynamically set the token, branch, and commit information.

const codecov = require('codecov');
codecov.upload({ token: process.env.CODECOV_TOKEN, file: 'coverage.xml', branch: process.env.CI_BRANCH, commit: process.env.CI_COMMIT });

Custom Flags

This feature allows you to add custom flags to your coverage reports. Flags can be used to differentiate between different types of tests or coverage reports.

const codecov = require('codecov');
codecov.upload({ token: 'your-codecov-token', file: 'coverage.xml', flags: 'unittests' });

Other packages similar to codecov

Readme

Source

codecov.io

NPM version Build Status codecov.io Dependency Status Dev Dependency Status

Codecov.io support for node.js. Get the great coverage reporting of codecov.io and add a cool coverage button ( like the one above ) to your README.

Installation:

Add the latest version of codecov.io to your package.json:

npm install codecov.io --save

Usage:

This script ( bin/codecov.io.js ) can take standard input from any tool that emits the lcov, gcov or standardized json data format and send it to codecov.io to report your code coverage there.

Once your app is instrumented for coverage, and building, you need to pipe the coverage reports output to ./node_modules/codecov.io/bin/codecov.io.js.

This library currently supports the following CI companies: Travis CI, Travis, Appveyor, CircleCI, Codeship, Drone, Jenkins, Shippable, Semaphore, Wercker, Snap CI, Buildkite.

Upload repo tokens

Repo tokens are not required for public repos tested on Travis-Org, CircleCI or AppVeyor.

Repo tokens are neccessary to distinquish your repository from others. You can find your repo token on your repository page at Codecov. Set this unique uuid to CODECOV_TOKEN in your environment variables.

export CODECOV_TOKEN=":uuid-repo-token"
# or
./node_modules/.bin/codecov --token=:token
Istanbul

With Mocha:

istanbul cover ./node_modules/mocha/bin/_mocha -- -R spec
./node_modules/.bin/codecov

With Jasmine:

istanbul cover jasmine-node --captureExceptions spec/
./node_modules/.bin/codecov

With Tape:

istanbul cover test.js
./node_modules/.bin/codecov

Advanced: Partial Line Coverage

Codecov does support partial line coverage. However, some node projects do not report partial coverage accurate enough. You can decide to upload the partial coverage report by chaning the target upload file to ./coverage/coverage.json. View your report on Codecov, if the reports are not accurate then switch back to the lcov provided above.

We are working on improving this implementation and appreciate your patience.

Contributing

I generally don't accept pull requests that are untested, or break the build, because I'd like to keep the quality high (this is a coverage tool afterall!).

I also don't care for "soft-versioning" or "optimistic versioning" (dependencies that have ^, x, > in them, or anything other than numbers and dots). There have been too many problems with bad semantic versioning in dependencies, and I'd rather have a solid library than a bleeding edge one.

Keywords

FAQs

Last updated on 16 Oct 2015

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc