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(readme): move advanced features to docs site #551

Merged
merged 4 commits into from
Apr 12, 2017
Merged
Changes from 1 commit
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
51 changes: 6 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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:**
Copy link
Member Author

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 the package.json example right above it. I'm hoping that the explanation above that the configuration can be set in either the package.json or .nycrc file is enough explanation.


```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
Expand All @@ -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.
Copy link
Member Author

Choose a reason for hiding this comment

The 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
Expand All @@ -354,7 +315,7 @@ integrated with coveralls and travis-ci.org:
```json
{
"script": {
"test": "nyc tap ./test/*.js",
"test": "nyc mocha",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made this change because tap uses nyc under the hood for coverage, so it doesn't make sense to go this way. Most of our tutorials use mocha so I thought I'd just continue that trend.

"coverage": "nyc report --reporter=text-lcov | coveralls"
}
}
Expand Down