{"id":13527318,"url":"https://github.com/nickmerwin/node-coveralls","last_synced_at":"2025-05-14T03:06:21.048Z","repository":{"id":7447879,"uuid":"8790144","full_name":"nickmerwin/node-coveralls","owner":"nickmerwin","description":"lcov posting to coveralls.io","archived":false,"fork":false,"pushed_at":"2023-05-01T08:36:52.000Z","size":1316,"stargazers_count":1066,"open_issues_count":73,"forks_count":258,"subscribers_count":18,"default_branch":"master","last_synced_at":"2024-10-29T14:51:22.819Z","etag":null,"topics":["coverage","coveralls","javascript","mocha","test-coverage"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nickmerwin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-03-15T02:10:57.000Z","updated_at":"2024-09-21T13:40:40.000Z","dependencies_parsed_at":"2024-06-03T20:34:50.521Z","dependency_job_id":"de008f62-1c80-4d4f-a9b5-5d3de9231ff5","html_url":"https://github.com/nickmerwin/node-coveralls","commit_stats":{"total_commits":322,"total_committers":87,"mean_commits":"3.7011494252873565","dds":0.7422360248447205,"last_synced_commit":"565da5f354758903445db6cbee3bdba9ec697b9e"},"previous_names":["cainus/node-coveralls"],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickmerwin%2Fnode-coveralls","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickmerwin%2Fnode-coveralls/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickmerwin%2Fnode-coveralls/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickmerwin%2Fnode-coveralls/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nickmerwin","download_url":"https://codeload.github.com/nickmerwin/node-coveralls/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237393069,"owners_count":19302721,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["coverage","coveralls","javascript","mocha","test-coverage"],"created_at":"2024-08-01T06:01:45.687Z","updated_at":"2025-02-06T00:14:15.492Z","avatar_url":"https://github.com/nickmerwin.png","language":"JavaScript","readme":"# node-coveralls\n\n[![Build Status][ci-image]][ci-url] [![Coverage Status][coveralls-image]][coveralls-url]\n\n[Coveralls.io](https://coveralls.io/) support for Node.js. Get the great coverage reporting of coveralls.io and add a cool coverage button (like the one above) to your README.\n\n## Supported CI services:\n\n* [Travis CI](https://travis-ci.org/)\n* [CodeShip](https://codeship.com/)\n* [CircleCI](https://circleci.com/)\n* [Jenkins](https://jenkins.io/)\n* [Gitlab CI](https://gitlab.com/)\n* [AppVeyor](https://www.appveyor.com/)\n* [Buildkite](https://buildkite.com/)\n* [GitHub Actions CI](https://github.com/features/actions)\n* [CodeFresh](https://codefresh.io/)\n\n## Installation:\n\nAdd the latest version of `coveralls` to your package.json:\n\n```shell\nnpm install coveralls --save-dev\n```\n\nIf you're using mocha, add `mocha-lcov-reporter` to your package.json:\n\n```shell\nnpm install mocha-lcov-reporter --save-dev\n```\n\n## Usage:\n\nThis script `bin/coveralls.js` can take standard input from any tool that emits the lcov data format (including [mocha](https://mochajs.org/)'s [LCOV reporter](https://npmjs.org/package/mocha-lcov-reporter)) and send it to coveralls.io to report your code coverage there.\n\nOnce your app is instrumented for coverage, and building, you need to pipe the lcov output to `./node_modules/coveralls/bin/coveralls.js`.\n\nThis library currently supports [Travis CI](https://travis-ci.org/) with no extra effort beyond piping the lcov output to coveralls. However, if you're using a different build system, there are a few **necessary** environment variables:\n\n- `COVERALLS_SERVICE_NAME` (the name of your build system)\n- `COVERALLS_REPO_TOKEN` (the secret repo token from coveralls.io)\n- `COVERALLS_GIT_BRANCH` (the branch name)\n\nThere are optional environment variables for other build systems as well:\n\n- `COVERALLS_FLAG_NAME` (a flag name to differentiate jobs, e.g. Unit, Functional, Integration)\n- `COVERALLS_SERVICE_NUMBER` (a number that uniquely identifies the build)\n- `COVERALLS_SERVICE_JOB_ID` (an ID that uniquely identifies the build's job)\n- `COVERALLS_SERVICE_JOB_NUMBER` (a number that uniquely identifies the build's job)\n- `COVERALLS_RUN_AT` (a date string for the time that the job ran. RFC 3339 dates work. This defaults to your build system's date/time if you don't set it)\n- `COVERALLS_PARALLEL` (set to `true` when running jobs in parallel, requires a completion webhook. More info here: \u003chttps://docs.coveralls.io/parallel-build-webhook\u003e)\n\n### GitHub Actions CI\n\nIf you are using GitHub Actions CI, you should look into [coverallsapp/github-action](https://github.com/coverallsapp/github-action).\n\nParallel runs example [workflow.yml](https://github.com/coverallsapp/coveralls-node-demo/blob/master/.github/workflows/workflow.yml)\n\n### [CircleCI Orb](https://circleci.com/)\n\nHere's our Orb for quick integration: [coveralls/coveralls](https://circleci.com/orbs/registry/orb/coveralls/coveralls)\n\nWorkflow example: [config.yml](https://github.com/coverallsapp/coveralls-node-demo/blob/master/.circleci/config.yml)\n\n### [Travis-CI](https://travis-ci.org/)\n\nParallel jobs example: [.travis.yml](https://github.com/coverallsapp/coveralls-node-demo/blob/master/.travis.yml)\n\n### [Jest](https://jestjs.io/)\n\n- Install [jest](https://jestjs.io/docs/en/getting-started)\n- Use the following to run tests and push files to coveralls on success:\n\n  ```sh\n  jest --coverage \u0026\u0026 coveralls \u003c coverage/lcov.info\n  ```\n\nCheck out an example [here](https://github.com/Ethan-Arrowood/harperdb-connect/blob/master/.travis.yml) which makes use of Travis CI build stages\n\n### [Mocha](https://mochajs.org/) + [Blanket.js](https://github.com/alex-seville/blanket)\n\n- Install [blanket.js](https://github.com/alex-seville/blanket)\n- Configure blanket according to [docs](https://github.com/alex-seville/blanket/blob/master/docs/getting_started_node.md).\n- Run your tests with a command like this:\n\n  ```sh\n  NODE_ENV=test YOURPACKAGE_COVERAGE=1 ./node_modules/.bin/mocha \\\n    --require blanket \\\n    --reporter mocha-lcov-reporter | ./node_modules/coveralls/bin/coveralls.js\n  ```\n\n### [Mocha](https://mochajs.org/) + [JSCoverage](https://github.com/fishbar/jscoverage)\n\nInstrumenting your app for coverage is probably harder than it needs to be (read [here](http://seejohncode.com/2012/03/13/setting-up-mocha-jscoverage/)), but that's also a necessary step.\n\nIn mocha, if you've got your code instrumented for coverage, the command for a Travis CI build would look something like this:\n\n```sh\nYOURPACKAGE_COVERAGE=1 ./node_modules/.bin/mocha test -R mocha-lcov-reporter | ./node_modules/coveralls/bin/coveralls.js\n```\n\nCheck out an example [Makefile](https://github.com/cainus/urlgrey/blob/master/Makefile) from one of my projects for an example, especially the test-coveralls build target. Note: Travis CI runs `npm test`, so whatever target you create in your Makefile must be the target that `npm test` runs (This is set in package.json's `scripts` property).\n\n### [Istanbul](https://github.com/gotwarlost/istanbul)\n\n#### With Mocha:\n\n```sh\nistanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec \u0026\u0026 cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js \u0026\u0026 rm -rf ./coverage\n```\n\n#### With Jasmine:\n\n```sh\nistanbul cover jasmine-node --captureExceptions spec/ \u0026\u0026 cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js \u0026\u0026 rm -rf ./coverage\n```\n\n### [Nodeunit](https://github.com/caolan/nodeunit) + [JSCoverage](https://github.com/fishbar/jscoverage)\n\nDepend on nodeunit, jscoverage, and coveralls:\n\n```sh\nnpm install nodeunit jscoverage coveralls --save-dev\n```\n\nAdd a coveralls script to \"scripts\" in your `package.json`:\n\n```json\n\"scripts\": {\n  \"test\": \"nodeunit test\",\n  \"coveralls\": \"jscoverage lib \u0026\u0026 YOURPACKAGE_COVERAGE=1 nodeunit --reporter=lcov test | coveralls\"\n}\n```\n\nEnsure your app requires instrumented code when `process.env.YOURPACKAGE_COVERAGE` variable is defined.\n\nRun your tests with a command like this:\n\n```sh\nnpm run coveralls\n```\n\nFor detailed instructions on requiring instrumented code, running on Travis CI and submitting to coveralls [see this guide](https://github.com/alanshaw/nodeunit-lcov-coveralls-example).\n\n### [Poncho](https://github.com/deepsweet/poncho)\n\nClient-side JS code coverage using [PhantomJS](https://github.com/ariya/phantomjs), [Mocha](https://mochajs.org/) and [Blanket](https://github.com/alex-seville/blanket):\n\n- [Configure](https://mochajs.org/#running-mocha-in-the-browser) Mocha for browser\n- [Mark](https://github.com/deepsweet/poncho#usage) target script(s) with `data-cover` HTML attribute\n- Run your tests with a command like this:\n\n  ```sh\n  ./node_modules/.bin/poncho -R lcov test/test.html | ./node_modules/coveralls/bin/coveralls.js\n  ```\n\n### [Lab](https://github.com/hapijs/lab)\n\n```sh\nlab -r lcov | ./node_modules/.bin/coveralls\n```\n\n### [nyc](https://github.com/istanbuljs/nyc)\n\nWorks with almost any testing framework. Simply execute\n`npm test` with the `nyc` bin followed by running its reporter:\n\n```shell\nnyc npm test \u0026\u0026 nyc report --reporter=text-lcov | coveralls\n```\n\n### [TAP](https://github.com/tapjs/node-tap)\n\nSimply run your tap tests with the `COVERALLS_REPO_TOKEN` environment\nvariable set and tap will automatically use `nyc` to report\ncoverage to coveralls.\n\n### Command Line Parameters\n\n```shell\nUsage: coveralls.js [-v] filepath\n```\n\n#### Optional arguments:\n\n- `-v`, `--verbose`\n- `filepath` - optionally defines the base filepath of your source files.\n\n## Running locally\n\nIf you're running locally, you must have a `.coveralls.yml` file, as documented in [their documentation](https://docs.coveralls.io/ruby-on-rails#configuration), with your `repo_token` in it; or, you must provide a `COVERALLS_REPO_TOKEN` environment variable on the command-line.\n\nIf you want to send commit data to coveralls, you can set the `COVERALLS_GIT_COMMIT` environment-variable to the commit hash you wish to reference. If you don't want to use a hash, you can set it to `HEAD` to supply coveralls with the latest commit data. This requires git to be installed and executable on the current PATH.\n\n## Contributing\n\nI 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 after all!).\n\nI also don't care for \"soft-versioning\" or \"optimistic versioning\" (dependencies that have ^, x, \u003e 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.\n\n\n[ci-image]: https://github.com/nickmerwin/node-coveralls/workflows/Tests/badge.svg\n[ci-url]: https://github.com/nickmerwin/node-coveralls/actions?workflow=Tests\n\n[coveralls-image]: https://coveralls.io/repos/nickmerwin/node-coveralls/badge.svg?branch=master\u0026service=github\n[coveralls-url]: https://coveralls.io/github/nickmerwin/node-coveralls?branch=master\n","funding_links":[],"categories":["Repository","JavaScript","javascript"],"sub_categories":["Testing"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnickmerwin%2Fnode-coveralls","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnickmerwin%2Fnode-coveralls","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnickmerwin%2Fnode-coveralls/lists"}