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

feat: Skip test coverage #643

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,23 @@ For example, if you want only to include files in the `app` folder but exclude t

Another important option is `excludeAfterRemap`. By default, it is false, which might let excluded files through. If you exclude the files, and the instrumenter does not respect the `nyc.exclude` setting, then add `excludeAfterRemap: true` to tell `nyc report` to exclude files. See [test-apps/exclude-files](test-apps/exclude-files).


## Skip test coverage collection for single spec file

Skip test coverage collection from being reported for a single spec file by using the test config object by setting `{skipTestCoverage : true}`. This will skip the execution of all hooks associated with code coverage collection. The test will still be included in the test suite but coverage values will not be collected or added to the code coverage report.


```js
describe('excludes test from code coverage reporting', {skipTestCoverage: true}, () => {
it(
'test expects 1 to equal 1',
{ skipTestCoverage: true },
() => {
expect(1).to.equal(1)
},
)
})
```
## Disable plugin

You can skip the client-side code coverage hooks by setting the environment variable `coverage` to `false`.
Expand Down
Loading