-
-
Notifications
You must be signed in to change notification settings - Fork 359
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(readme): move advanced features to docs site #551
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -241,6 +241,7 @@ Any configuration options that can be set via the command line can also be speci | |
{ | ||
"description": "These are just examples for demonstration, nothing prescriptive", | ||
"nyc": { | ||
"check-coverage": true, | ||
"lines": 99, | ||
"statements": 99, | ||
"functions": 99, | ||
|
@@ -263,55 +264,11 @@ Any configuration options that can be set via the command line can also be speci | |
], | ||
"cache": true, | ||
"all": true, | ||
"check-coverage": true, | ||
"report-dir": "./alternative" | ||
} | ||
} | ||
``` | ||
|
||
**.nycrc:** | ||
|
||
```json | ||
{ | ||
"reporter": [ | ||
"lcov", | ||
"text-summary" | ||
], | ||
"require": [ | ||
"./test/helpers/some-helper.js" | ||
] | ||
} | ||
``` | ||
|
||
## Instrumenting source files | ||
|
||
nyc's `instrument` command can be used to instrument | ||
source files outside of the context of your unit-tests: | ||
|
||
__instrument the entire ./lib folder:__ | ||
|
||
`nyc instrument ./lib ./output` | ||
|
||
## Process tree information | ||
|
||
nyc is able to show you all Node processes that are spawned when running a | ||
test script under it: | ||
|
||
``` | ||
$ nyc --show-process-tree npm test | ||
3 passed | ||
----------|----------|----------|----------|----------|----------------| | ||
File | % Stmts | % Branch | % Funcs | % Lines |Uncovered Lines | | ||
----------|----------|----------|----------|----------|----------------| | ||
All files | 100 | 100 | 100 | 100 | | | ||
index.js | 100 | 100 | 100 | 100 | | | ||
----------|----------|----------|----------|----------|----------------| | ||
nyc | ||
└─┬ /usr/local/bin/node /usr/local/bin/npm test | ||
└─┬ /usr/local/bin/node /path/to/your/project/node_modules/.bin/ava | ||
└── /usr/local/bin/node /path/to/your/project/node_modules/ava/lib/test-worker.js … | ||
``` | ||
|
||
## High and low watermarks | ||
|
||
Several of the coverage reporters supported by nyc display special information | ||
|
@@ -337,6 +294,10 @@ You can specify custom high and low watermarks in nyc's configuration: | |
} | ||
``` | ||
|
||
## Other advanced features | ||
|
||
Take a look at http://istanbul.js.org/docs/advanced/ and please feel free to contribute documentation. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Definitely open to improving this copy. |
||
|
||
## Integrating with coveralls | ||
|
||
[coveralls.io](https://coveralls.io) is a great tool for adding | ||
|
@@ -354,7 +315,7 @@ integrated with coveralls and travis-ci.org: | |
```json | ||
{ | ||
"script": { | ||
"test": "nyc tap ./test/*.js", | ||
"test": "nyc mocha", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I made this change because |
||
"coverage": "nyc report --reporter=text-lcov | coveralls" | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed this section on the
.nycrc
example because it might cause confusion with thepackage.json
example right above it. I'm hoping that the explanation above that the configuration can be set in either thepackage.json
or.nycrc
file is enough explanation.