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: Add support to change files tree in reporter . --summarizer=flat|nested|pkg option #1370

Open
wants to merge 1 commit into
base: main
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
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,20 @@ If you opt to pre-instrument your source-code (rather than using a just-in-time
_Important: If you are using nyc with a project that pre-instruments its code, run nyc with the configuration option `--exclude-after-remap` set to `false`.
Otherwise nyc's reports will exclude any files that source-maps remap to folders covered under exclude rules._

### Changing files tree structure in report

Instanbul is able to show report files in different ways. Option `--summarizer` defines 4 ways to do so:
`flat` - all files are reported as one flat list with full path
`nested` - all files are reported as one nested tree list, which shows folders and files
`pkg` - files are reported in collapsed list similar to file explorers showing only current folder's children
`defaultSummarizer` - default summarizer defined in `istanbul-lib-report` package. So far it is `pkg`

```json
{
"summarizer": "flat"
}
```

## [Integrating with coveralls](./docs/setup-coveralls.md)

## [Integrating with codecov](./docs/setup-codecov.md)
Expand Down
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,7 @@ class NYC {
const reports = require('istanbul-reports')

const context = libReport.createContext({
defaultSummarizer: this.config.summarizer,
dir: this.reportDirectory(),
watermarks: this.config.watermarks,
coverageMap: await this.getCoverageMapFromAllCoverageFiles()
Expand Down