-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
de549c8
commit 70f516a
Showing
1 changed file
with
8 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
# Deno Test Coverage | ||
# Simple Coverage | ||
|
||
shell script to collect test coverage when testing with Deno's built-in test | ||
runner | ||
Collect test coverage with Deno's built-in test runner and lcov | ||
|
||
## Usage | ||
|
||
|
@@ -12,36 +11,36 @@ bundled with lcov. lcov can be installed with Homebrew on macOS. | |
brew install lcov | ||
``` | ||
|
||
### Deno | ||
### 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/[email protected].1/coverage.ts | ||
deno run --allow-run --allow-read --allow-write https://deno.land/x/[email protected].2/coverage.ts | ||
``` | ||
|
||
or | ||
|
||
``` | ||
deno run --allow-all https://deno.land/x/[email protected].1/coverage.ts | ||
deno run --allow-all https://deno.land/x/[email protected].2/coverage.ts | ||
``` | ||
|
||
Additionally pass `open` as an argument to open the coverage report | ||
|
||
``` | ||
deno run --allow-all https://deno.land/x/[email protected].1/coverage.ts open | ||
deno run --allow-all https://deno.land/x/[email protected].2/coverage.ts open | ||
``` | ||
|
||
### Bash | ||
|
||
To run this script with Bash first copy the contents of coverage.sh to a project | ||
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://raw.githubusercontent.com/theogainey/Deno-Test-Coverage/main/coverage.sh -o coverage.sh | ||
curl -sL https://deno.land/x/[email protected]/coverage.sh -o coverage.sh | ||
``` | ||
|
||
after adding the script to a project a test coverage report can generated with | ||
|