Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(codecov): favour npx over installing locally #1074

Merged
merged 1 commit into from
Apr 18, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions docs/setup-codecov.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
# 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](https://docs.codecov.io/docs/browser-extension).

[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:
## Quick start

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):
Assuming your `npm test` does not run `nyc` and you have the `npx` executable (npm v5.2+), have your CI runner execute the following:
```shell
npx nyc --reporter=lcov npm test && npx codecov
```

1. add the codecov and nyc dependencies to your module:
## Without `npx` - TravisCI example using npm scripts

1. add the codecov and nyc dependencies:

```shell
npm install nyc --save-dev
npm install codecov nyc --save-dev
```

2. update the scripts in your package.json to include these lines:
2. update the scripts in your package.json to include these lines (replace `mocha` with your test runner):

```json
{
"scripts": {
"test": "nyc --reporter=lcov mocha ./test/*.js",
"coverage": "npx codecov"
"test": "nyc --reporter=lcov mocha",
"coverage": "codecov"
}
}
```
Expand Down