Skip to content

Commit

Permalink
docs: README
Browse files Browse the repository at this point in the history
add deno subprocess documentation
  • Loading branch information
theogainey committed Apr 11, 2022
1 parent de6cca5 commit 0da09d8
Showing 1 changed file with 28 additions and 4 deletions.
32 changes: 28 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,39 @@ bundled with lcov. lcov can be installed with Homebrew on macOS.
brew install lcov
```

to use this script first copy the contents of coverage.sh to a project or this
script can also added to a project via a command line
### Deno

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://raw.githubusercontent.com/theogainey/Deno-Test-Coverage/main/coverage.ts
```

or

```
deno run --allow-all https://raw.githubusercontent.com/theogainey/Deno-Test-Coverage/main/coverage.ts
```

Additionally pass `open` as an argument to open the coverage report

```
deno run --allow-all https://raw.githubusercontent.com/theogainey/Deno-Test-Coverage/main/coverage.ts open
```

### Bash

To run this script with Bash 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
```

after adding the script to a project a test coverage report can
generated with
after adding the script to a project a test coverage report can generated with

```
sh coverage.sh
Expand Down

0 comments on commit 0da09d8

Please sign in to comment.