Skip to content
This repository was archived by the owner on Feb 19, 2020. It is now read-only.

Commit 4e9dae1

Browse files
authored
Make token choice more explicit
1 parent 1e396c1 commit 4e9dae1

File tree

1 file changed

+21
-13
lines changed

1 file changed

+21
-13
lines changed

README.md

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ npm install mocha-lcov-reporter --save
2828

2929
## Enterprise
3030

31-
To send coverage in the enterprise version you should specify your Codacy installation URL:
31+
To send coverage in the enterprise version you should specify your Codacy installation URL with the option `-e`:
3232

3333
```sh
3434
codacy-coverage -e <YOUR-CODACY-ENTERPRISE-URL>:16006
@@ -40,13 +40,18 @@ This cli can take standard input from any tool that emits the lcov data format (
4040

4141
Once your app is instrumented for coverage, and building, you need to pipe the lcov output to `codacy-coverage`.
4242

43-
You'll need to provide the Report token from Codacy via an environment variable:
43+
### Identifying the project
4444

45-
* CODACY_PROJECT_TOKEN (the secret repo token from Codacy.com)
45+
You'll need to provide the secret Project API token from `Codacy Project > Settings > Integrations > Project API` via:
4646

47-
> Note: You should keep your API token well **protected**, as it grants owner permissions to your projects.
47+
* (Recommended) Environment variable: CODACY_PROJECT_TOKEN
48+
* CLI parameter variable: `--token`
4849

49-
### [Mocha](http://mochajs.org) + [Blanket.js](https://github.com/alex-seville/blanket)
50+
> Note: You should keep your any API token well **protected**, as it grants owner permissions to your projects.
51+
52+
### Test Coverage
53+
54+
#### [Mocha](http://mochajs.org) + [Blanket.js](https://github.com/alex-seville/blanket)
5055

5156
* Install [blanket.js](http://blanketjs.org/)
5257
* Configure blanket according to [docs](https://github.com/alex-seville/blanket/blob/master/docs/getting_started_node.md).
@@ -64,7 +69,7 @@ You'll need to provide the Report token from Codacy via an environment variable:
6469
npm run test-with-coverage
6570
```
6671

67-
### [Mocha](http://mochajs.org) + [JSCoverage](https://github.com/fishbar/jscoverage)
72+
#### [Mocha](http://mochajs.org) + [JSCoverage](https://github.com/fishbar/jscoverage)
6873

6974
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.
7075

@@ -82,9 +87,9 @@ Instrumenting your app for coverage is probably harder than it needs to be (read
8287
npm run test-with-coverage
8388
```
8489

85-
### [Istanbul](https://github.com/gotwarlost/istanbul)
90+
#### [Istanbul](https://github.com/gotwarlost/istanbul)
8691

87-
#### With Mocha
92+
##### With Mocha
8893

8994
* Add test with coverage step to your package.json:
9095

@@ -100,7 +105,7 @@ npm run test-with-coverage
100105
npm run test-with-coverage
101106
```
102107

103-
#### With Jasmine
108+
##### With Jasmine
104109

105110
* Add test with coverage step to your package.json:
106111

@@ -116,7 +121,7 @@ npm run test-with-coverage
116121
npm run test-with-coverage
117122
```
118123

119-
### [Poncho](https://github.com/deepsweet/poncho)
124+
#### [Poncho](https://github.com/deepsweet/poncho)
120125

121126
Client-side JS code coverage using [PhantomJS](https://github.com/ariya/phantomjs), [Mocha](http://mochajs.org) and [Blanket](https://github.com/alex-seville/blanket):
122127

@@ -136,7 +141,7 @@ Client-side JS code coverage using [PhantomJS](https://github.com/ariya/phantomj
136141
npm run test-with-coverage
137142
```
138143

139-
### [Jest](https://facebook.github.io/jest/)
144+
#### [Jest](https://facebook.github.io/jest/)
140145

141146
* Add test with coverage step to your package.json:
142147

@@ -156,7 +161,7 @@ npm run test-with-coverage
156161

157162
### Account Token
158163

159-
To send coverage using your account/api token you can follow the following steps.
164+
As an alternative to the Project API token you can also send coverage using your account/api token by following steps:
160165

161166
* Add test with coverage step to your package.json:
162167

@@ -172,7 +177,10 @@ To send coverage using your account/api token you can follow the following steps
172177
npm run test-with-coverage
173178
```
174179

175-
As an alternative you can also export `CODACY_ACCOUNT_TOKEN` instead of passing `--accountToken <account-token>` to the CLI.
180+
You'll need to provide the secret Account API token from [Codacy Account](https://app.codacy.com/account/apiTokens)` > API Tokens` via:
181+
182+
* (Recommended) Environment variable: CODACY_ACCOUNT_TOKEN
183+
* CLI parameter variable: `--accountToken`
176184

177185
### Force custom language (e.g. Typescript, Coffeescript, C, ...)
178186

0 commit comments

Comments
 (0)