https://github.com/theogainey/simple-coverage
collect test coverage with Deno's built-in test runner and lcov
https://github.com/theogainey/simple-coverage
coverage deno lcov lcov-report testing-tools
Last synced: 4 months ago
JSON representation
collect test coverage with Deno's built-in test runner and lcov
- Host: GitHub
- URL: https://github.com/theogainey/simple-coverage
- Owner: theogainey
- License: mit
- Created: 2022-04-06T14:29:04.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-04-11T20:41:55.000Z (about 4 years ago)
- Last Synced: 2025-10-20T16:43:04.820Z (8 months ago)
- Topics: coverage, deno, lcov, lcov-report, testing-tools
- Language: TypeScript
- Homepage: https://deno.land/x/simple_coverage
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Simple Coverage
Collect test coverage with Deno's built-in test runner and lcov
## Usage
code coverage report is generated with a utility called genhtml that comes
bundled with lcov. lcov can be installed with Homebrew on macOS.
```
brew install lcov
```
### Deno Subprocess
Deno is capable of spawning a subprocess and supports url imports. As a result,
a code coverage report can be generated via the command line. There is no need
to install any dependencies, just open a command line where you would normally
run `deno test` and use the following code.
```
deno run --allow-run --allow-read --allow-write https://deno.land/x/simple_coverage@v1.0.2/coverage.ts
```
or
```
deno run --allow-all https://deno.land/x/simple_coverage@v1.0.2/coverage.ts
```
Additionally pass `open` as an argument to open the coverage report
```
deno run --allow-all https://deno.land/x/simple_coverage@v1.0.2/coverage.ts open
```
### Bash
Alternativly you can acheive the same results by using the provided Bash script. First copy the contents of coverage.sh to a project
or this script can also added to a project via a command line
```
curl -sL https://deno.land/x/simple_coverage@v1.0.2/coverage.sh -o coverage.sh
```
after adding the script to a project a test coverage report can generated with
```
sh coverage.sh
```