-
-
Notifications
You must be signed in to change notification settings - Fork 359
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: move setup docs out of the readme [skip ci] (#1052)
- Loading branch information
Showing
3 changed files
with
70 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Integrating with codecov.io | ||
|
||
> **tl;dr**: | ||
> `nyc --reporter=lcov npm test && npx codecov` | ||
[codecov](https://codecov.io/) is a great tool for adding | ||
coverage reports to your GitHub project, even viewing them inline on GitHub with a browser extension: | ||
|
||
Here's how to get `nyc` integrated with codecov and travis-ci.org, assuming you have the `npx` executable (included with npm v5.2 and above): | ||
|
||
1. add the codecov and nyc dependencies to your module: | ||
|
||
```shell | ||
npm install nyc --save-dev | ||
``` | ||
|
||
2. update the scripts in your package.json to include these lines: | ||
|
||
```json | ||
{ | ||
"scripts": { | ||
"test": "nyc --reporter=lcov mocha ./test/*.js", | ||
"coverage": "npx codecov" | ||
} | ||
} | ||
``` | ||
|
||
3. For private repos, add the environment variable `CODECOV_TOKEN` to travis. | ||
|
||
4. add the following to your `.travis.yml`: | ||
|
||
```yaml | ||
after_success: npm run coverage | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Integrating with coveralls.io | ||
|
||
[coveralls.io](https://coveralls.io) is a great tool for adding | ||
coverage reports to your GitHub project. Here's how to get nyc | ||
integrated with coveralls and travis-ci.org: | ||
|
||
1. add the coveralls and nyc dependencies to your module: | ||
|
||
```shell | ||
npm install coveralls nyc --save-dev | ||
``` | ||
|
||
2. update the scripts in your package.json to include these bins: | ||
|
||
```json | ||
{ | ||
"scripts": { | ||
"test": "nyc mocha", | ||
"coverage": "nyc report --reporter=text-lcov | coveralls" | ||
} | ||
} | ||
``` | ||
|
||
3. For private repos, add the environment variable `COVERALLS_REPO_TOKEN` to travis. | ||
|
||
4. add the following to your `.travis.yml`: | ||
|
||
```yaml | ||
after_success: npm run coverage | ||
``` | ||
|
||
That's all there is to it! | ||
> 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?`. |