Skip to content

Commit 0488f10

Browse files
XhmikosRnickmerwin
authored andcommitted
Tweak README.md
* fix redirected links and use https when possible * Markdown consistency changes
1 parent be79dab commit 0488f10

File tree

1 file changed

+71
-53
lines changed

1 file changed

+71
-53
lines changed

README.md

Lines changed: 71 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -3,73 +3,85 @@
33
[![Build Status][ci-image]][ci-url] [![Coverage Status][coveralls-image]][coveralls-url]
44
[![Known Vulnerabilities](https://snyk.io/test/github/nickmerwin/node-coveralls/badge.svg)](https://snyk.io/test/github/nickmerwin/node-coveralls)
55

6-
[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.
6+
[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.
77

8-
Supported CI services: [travis-ci](https://travis-ci.org/), [codeship](https://www.codeship.io/), [circleci](https://circleci.com/), [jenkins](http://jenkins-ci.org/), [Gitlab CI](http://gitlab.com/), [AppVeyor](http://appveyor.com/), [Buildkite](https://buildkite.com/)
8+
Supported CI services: [Travis CI](https://travis-ci.org/), [CodeShip](https://codeship.com/), [CircleCI](https://circleci.com/), [Jenkins](https://jenkins.io/), [Gitlab CI](https://gitlab.com/), [AppVeyor](https://www.appveyor.com/), [Buildkite](https://buildkite.com/)
99

1010
## Installation:
11+
1112
Add the latest version of `coveralls` to your package.json:
12-
```
13+
14+
```shell
1315
npm install coveralls --save-dev
1416
```
1517

1618
If you're using mocha, add `mocha-lcov-reporter` to your package.json:
17-
```
19+
20+
```shell
1821
npm install mocha-lcov-reporter --save-dev
1922
```
2023

2124
## Usage:
2225

23-
This script ( `bin/coveralls.js` ) can take standard input from any tool that emits the lcov data format (including [mocha](http://mochajs.org/)'s [LCov reporter](https://npmjs.org/package/mocha-lcov-reporter)) and send it to coveralls.io to report your code coverage there.
26+
This 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.
2427

2528
Once your app is instrumented for coverage, and building, you need to pipe the lcov output to `./node_modules/coveralls/bin/coveralls.js`.
2629

27-
This 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 environment variables that are necessary:
28-
* COVERALLS_SERVICE_NAME (the name of your build system)
29-
* COVERALLS_REPO_TOKEN (the secret repo token from coveralls.io)
30+
This 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 environment variables that are necessary:
31+
32+
- `COVERALLS_SERVICE_NAME` (the name of your build system)
33+
- `COVERALLS_REPO_TOKEN` (the secret repo token from coveralls.io)
3034

3135
There are optional environment variables for other build systems as well:
32-
* COVERALLS_SERVICE_JOB_ID (an id that uniquely identifies the build job)
33-
* COVERALLS_RUN_AT (a date string for the time that the job ran. RFC 3339 dates work. This defaults to your
34-
build system's date/time if you don't set it.)
35-
* COVERALLS_PARALLEL (more info here: https://docs.coveralls.io/parallel-build-webhook)
36-
### [Jest](https://facebook.github.io/jest/)
37-
- Install [jest](https://facebook.github.io/jest/docs/en/getting-started.html)
38-
- Use the following to run tests and push files to coveralls:
39-
```sh
40-
jest --coverage --coverageReporters=text-lcov | coveralls
41-
```
42-
Check out an example [here](https://github.com/Ethan-Arrowood/harperdb-connect/blob/master/.travis.yml) which makes use of Travis-CI build stages
4336

44-
### [Mocha](http://mochajs.org/) + [Blanket.js](https://github.com/alex-seville/blanket)
45-
- Install [blanket.js](http://blanketjs.org/)
37+
- `COVERALLS_SERVICE_JOB_ID` (an id that uniquely identifies the build job)
38+
- `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.)
39+
- `COVERALLS_PARALLEL` (more info here: <https://docs.coveralls.io/parallel-build-webhook>)
40+
41+
### [Jest](https://jestjs.io/)
42+
43+
- Install [jest](https://jestjs.io/docs/en/getting-started)
44+
- Use the following to run tests and push files to coveralls:
45+
46+
```sh
47+
jest --coverage --coverageReporters=text-lcov | coveralls
48+
```
49+
50+
Check out an example [here](https://github.com/Ethan-Arrowood/harperdb-connect/blob/master/.travis.yml) which makes use of Travis CI build stages
51+
52+
### [Mocha](https://mochajs.org/) + [Blanket.js](https://github.com/alex-seville/blanket)
53+
54+
- Install [blanket.js](https://github.com/alex-seville/blanket)
4655
- Configure blanket according to [docs](https://github.com/alex-seville/blanket/blob/master/docs/getting_started_node.md).
4756
- Run your tests with a command like this:
4857

49-
```sh
50-
NODE_ENV=test YOURPACKAGE_COVERAGE=1 ./node_modules/.bin/mocha \
51-
--require blanket \
52-
--reporter mocha-lcov-reporter | ./node_modules/coveralls/bin/coveralls.js
53-
```
54-
### [Mocha](http://mochajs.org/) + [JSCoverage](https://github.com/fishbar/jscoverage)
58+
```sh
59+
NODE_ENV=test YOURPACKAGE_COVERAGE=1 ./node_modules/.bin/mocha \
60+
--require blanket \
61+
--reporter mocha-lcov-reporter | ./node_modules/coveralls/bin/coveralls.js
62+
```
63+
64+
### [Mocha](https://mochajs.org/) + [JSCoverage](https://github.com/fishbar/jscoverage)
5565

56-
Instrumenting your app for coverage is probably harder than it needs to be (read [here](http://www.seejohncode.com/2012/03/13/setting-up-mocha-jscoverage/)), but that's also a necessary step.
66+
Instrumenting 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.
67+
68+
In mocha, if you've got your code instrumented for coverage, the command for a Travis CI build would look something like this:
5769

58-
In mocha, if you've got your code instrumented for coverage, the command for a travis build would look something like this:
5970
```sh
6071
YOURPACKAGE_COVERAGE=1 ./node_modules/.bin/mocha test -R mocha-lcov-reporter | ./node_modules/coveralls/bin/coveralls.js
6172
```
62-
Check 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 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).
73+
74+
Check 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).
6375

6476
### [Istanbul](https://github.com/gotwarlost/istanbul)
6577

66-
**With Mocha:**
78+
#### With Mocha:
6779

6880
```sh
6981
istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage
7082
```
7183

72-
**With Jasmine:**
84+
#### With Jasmine:
7385

7486
```sh
7587
istanbul cover jasmine-node --captureExceptions spec/ && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage
@@ -85,7 +97,7 @@ npm install nodeunit jscoverage coveralls --save-dev
8597

8698
Add a coveralls script to "scripts" in your `package.json`:
8799

88-
```javascript
100+
```json
89101
"scripts": {
90102
"test": "nodeunit test",
91103
"coveralls": "jscoverage lib && YOURPACKAGE_COVERAGE=1 nodeunit --reporter=lcov test | coveralls"
@@ -100,29 +112,32 @@ Run your tests with a command like this:
100112
npm run coveralls
101113
```
102114

103-
For detailed instructions on requiring instrumented code, running on Travis and submitting to coveralls [see this guide](https://github.com/alanshaw/nodeunit-lcov-coveralls-example).
115+
For 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).
104116

105117
### [Poncho](https://github.com/deepsweet/poncho)
106-
Client-side JS code coverage using [PhantomJS](https://github.com/ariya/phantomjs), [Mocha](http://mochajs.org/) and [Blanket](https://github.com/alex-seville/blanket):
107-
- [Configure](http://mochajs.org/#running-mocha-in-the-browser) Mocha for browser
108-
- [Mark](https://github.com/deepsweet/poncho#usage) target script(s) with `data-cover` html-attribute
118+
119+
Client-side JS code coverage using [PhantomJS](https://github.com/ariya/phantomjs), [Mocha](https://mochajs.org/) and [Blanket](https://github.com/alex-seville/blanket):
120+
121+
- [Configure](https://mochajs.org/#running-mocha-in-the-browser) Mocha for browser
122+
- [Mark](https://github.com/deepsweet/poncho#usage) target script(s) with `data-cover` HTML attribute
109123
- Run your tests with a command like this:
110124

111-
```sh
112-
./node_modules/.bin/poncho -R lcov test/test.html | ./node_modules/coveralls/bin/coveralls.js
113-
```
125+
```sh
126+
./node_modules/.bin/poncho -R lcov test/test.html | ./node_modules/coveralls/bin/coveralls.js
127+
```
114128

115129
### [Lab](https://github.com/hapijs/lab)
130+
116131
```sh
117132
lab -r lcov | ./node_modules/.bin/coveralls
118133
```
119134

120-
### [nyc](https://github.com/bcoe/nyc)
135+
### [nyc](https://github.com/istanbuljs/nyc)
121136

122-
works with almost any testing framework. Simply execute
137+
Works with almost any testing framework. Simply execute
123138
`npm test` with the `nyc` bin followed by running its reporter:
124139

125-
```
140+
```shell
126141
nyc npm test && nyc report --reporter=text-lcov | coveralls
127142
```
128143

@@ -133,28 +148,31 @@ variable set and tap will automatically use `nyc` to report
133148
coverage to coveralls.
134149

135150
### Command Line Parameters
151+
152+
```shell
136153
Usage: coveralls.js [-v] filepath
154+
```
137155

138156
#### Optional arguments:
139157

140-
-v, --verbose
141-
142-
filepath - optionally defines the base filepath of your source files.
158+
- `-v`, `--verbose`
159+
- `filepath` - optionally defines the base filepath of your source files.
143160

144161
## Running locally
145162

146-
If you're running locally, you must have a `.coveralls.yml` file, as documented in [their documentation](https://coveralls.io/docs/ruby), with your `repo_token` in it; or, you must provide a `COVERALLS_REPO_TOKEN` environment-variable on the command-line.
163+
If 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.
147164

148165
If 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.
149166

167+
## Contributing
168+
169+
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 after all!).
170+
171+
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.
172+
173+
150174
[ci-image]: https://github.com/nickmerwin/node-coveralls/workflows/Tests/badge.svg
151175
[ci-url]: https://github.com/nickmerwin/node-coveralls/actions?workflow=Tests
152176

153177
[coveralls-image]: https://coveralls.io/repos/nickmerwin/node-coveralls/badge.svg?branch=master&service=github
154178
[coveralls-url]: https://coveralls.io/github/nickmerwin/node-coveralls?branch=master
155-
156-
## Contributing
157-
158-
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!).
159-
160-
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.

0 commit comments

Comments
 (0)