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: add missing description for --exclude-after-remap #413

Merged
merged 5 commits into from Jul 19, 2022
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 17 additions & 0 deletions README.md
Expand Up @@ -36,6 +36,7 @@ Here is a list of common options. Run `c8 --help` for the full list and document
| `--src` | see [section below](#checking-for-full-source-coverage-using---all) for more info | `Array<string>` | `[process.cwd()]`|
| `-n`, `--include` | see [section below](#checking-for-full-source-coverage-using---all) for more info | `Array<string>` | `[]` (include all files) |
| `-x`, `--exclude` | see [section below](#checking-for-full-source-coverage-using---all) for more info | `Array<string>` | [list](https://github.com/istanbuljs/schema/blob/master/default-exclude.js) |
| `--exclude-after-remap` | see [section below](#exclude-after-remap) for more info | `boolean` | `false` |
| `-e`, `--extension` | only files matching these extensions will show coverage | `string \| Array<string>` | [list](https://github.com/istanbuljs/schema/blob/master/default-extension.js) |
| `--skip-full` | do not show files with 100% statement, branch, and function coverage | `boolean` | `false` |
| `--check-coverage` | check whether coverage is within thresholds provided | `boolean` | `false` |
Expand All @@ -53,6 +54,22 @@ By supplying `--all` to c8, all files in directories specified with `--src` (def
and `--exclude` flag checks, will be loaded into the report. If any of those files remain uncovered they will be factored
into the report with a default of 0% coverage.

## Pre-instrumented versus just-in-time instrumented codebases
ArrayZoneYour marked this conversation as resolved.
Show resolved Hide resolved

### Source map files versus inline source maps

Just-in-time instrumented codebases will often insert source maps inline with the `.js` code they generate at runtime (e.g, `@babel/register` can be configured to insert a source map footer).

Pre-instrumented codebases, e.g., running `tsc` to generate `.js` in a build folder, may generate either inline source maps, or a separate `.map` file stored on disk.

`c8` can handle loading both types of source maps.

### Exclude after remap

For independent projects, feel free to set `--exclude-after-remap` as `true` or `false`, the only difference is that the exclusions are applied to _**source**_ scripts or _**executable**_ scripts.

For huge 'shared codebase' such as monorepo, your test suites can use common libs as workspace node_modules and _**executable**_ scripts is a single bundle, set `--exclude-after-remap` to true may help to set exclusions more precisely.
ArrayZoneYour marked this conversation as resolved.
Show resolved Hide resolved

## c8 report

run `c8 report` to regenerate reports after `c8` has already been run.
Expand Down