tj.git-extras/tests/README.md
罗泽轩 d11e45f0b1
port python tests to bats (#1264)
Signed-off-by: spacewander <spacewanderlzx@gmail.com>
2026-08-12 15:43:59 +08:00

24 lines
544 B
Markdown

# Testing
Tests are written in Bats so coverage can be calculated for shell commands.
## Bats Testing
We require a somewhat recent version of Bats. Version v1.8.1 is tested in CI. Once it is installed, the tests can be executed like so:
```sh
bats ./tests
```
We highly recommend adding Bats tests for new features and fixes.
### Code Coverage
Coverage can be calculated with [bashcov](https://github.com/infertux/bashcov) like so:
```sh
bashcov -- bats ./tests
```
By default, the report will be generated in `./coverage/index.html`.