Skip to content

Commit

Permalink
docs: update README
Browse files Browse the repository at this point in the history
  • Loading branch information
theogainey committed Apr 11, 2022
1 parent de549c8 commit 70f516a
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions README.md
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

Expand All @@ -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
Expand Down

0 comments on commit 70f516a

Please sign in to comment.