Skip to content

Commit f775a2e

Browse files
rgbkrkbcoe
authored andcommitted
docs: provide codecov instructions (#233)
1 parent f320bc6 commit f775a2e

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

README.md

+39
Original file line numberDiff line numberDiff line change
@@ -240,3 +240,42 @@ integrated with coveralls and travis-ci.org:
240240
That's all there is to it!
241241
242242
> Note: by default coveralls.io adds comments to pull-requests on GitHub, this can feel intrusive. To disable this, click on your repo on coveralls.io and uncheck `LEAVE COMMENTS?`.
243+
244+
245+
## Integrating with codecov
246+
247+
nyc npm test && nyc report --reporter=text-lcov > coverage.lcov && codecov
248+
249+
[codecov](https://codecov.io/) is a great tool for adding
250+
coverage reports to your GitHub project, even viewing them inline on GitHub with a browser extension:
251+
252+
![browser extension](https://d234q63orb21db.cloudfront.net/ad63907877249140772dff929ad1c340e424962a/media/images/next/extension.png)
253+
254+
Here's how to get `nyc` integrated with codecov and travis-ci.org:
255+
256+
1. add the codecov and nyc dependencies to your module:
257+
258+
```shell
259+
npm install codecov nyc --save-dev
260+
```
261+
262+
2. update the scripts in your package.json to include these bins:
263+
264+
```json
265+
{
266+
"script": {
267+
"test": "nyc tap ./test/*.js",
268+
"coverage": "nyc report --reporter=text-lcov > coverage.lcov && codecov"
269+
}
270+
}
271+
```
272+
273+
3. For private repos, add the environment variable `CODECOV_TOKEN` to travis.
274+
275+
4. add the following to your `.travis.yml`:
276+
277+
```yaml
278+
after_success: npm run coverage
279+
```
280+
281+
That's all there is to it!

0 commit comments

Comments
 (0)