Skip to content

Commit

Permalink
feat: Add test coverage commands for Go and Shell tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mattevans committed Dec 19, 2024
1 parent 2e7469a commit 3f87bea
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,25 @@ Or just run the short tests:
go test -test.short ./...
```

Or with coverage:

```bash
go test -failfast -cover -coverpkg=./... -coverprofile=coverage.out ./... && go tool cover -html=coverage.out
```

### Shell Tests

You'll need [`bats`](https://github.com/bats-core/bats-core) installed if you don't already.

```bash
bats *.bats
```

If you want to run the tests with coverage, install `kcov` and you can use the following command:

```bash
kcov --bash-parser="$(which bash)" /path/to/coverage/output bats --tap install.bats
```



0 comments on commit 3f87bea

Please sign in to comment.