https://github.com/keewek/vscode-nyc-coverage-example
VS Code NYC test coverage example.
https://github.com/keewek/vscode-nyc-coverage-example
coverage example istanbuljs nyc-coverage test test-runner typescript visual-studio-code vscode vscode-extension
Last synced: about 2 months ago
JSON representation
VS Code NYC test coverage example.
- Host: GitHub
- URL: https://github.com/keewek/vscode-nyc-coverage-example
- Owner: keewek
- License: mit
- Created: 2020-11-22T13:57:33.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2020-11-24T14:10:21.000Z (over 5 years ago)
- Last Synced: 2026-02-23T03:50:04.984Z (4 months ago)
- Topics: coverage, example, istanbuljs, nyc-coverage, test, test-runner, typescript, visual-studio-code, vscode, vscode-extension
- Language: TypeScript
- Homepage:
- Size: 101 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# VS Code NYC test coverage example
An example on how to get test coverage with NYC for VS Code extensions.
## Features
- GUI to pick a test suite files
- Preselect
- Preselects currently open module's `.test.ts` suite file

- Preselects currently open `.test.ts` suite file

## Additions to 'yo code' template
- Added `nyc` to `devDependencies`
```
npm install --save-dev nyc
```
- Added `npm: pretest` task which is used by 'Extension Tests (Coverage)' configuration
- Added `Extension Tests (Select)` configuration
- Shows GUI to pick a test suite files
- Preselects with currently open file
- Added `Extension Tests (Coverage)` configuration
- Shows GUI to pick a test suite files
- Preselects with currently open file
- Generates a test coverage report
- Added `nyc-coverage-test-runner.ts`
These additions make it easier to see coverage report in isolation.
For example:
Running test coverage for `module-c` in this example will show 100% coverage.

While running test coverage for `module-a` & `module-b` will show

as their test suites are missing some branches.


## Known Issues
Coverage report will be empty with `*` as one of the `activationEvents` in `package.json`.