https://github.com/max-te/mutant-report
HTML reports for cargo-mutants
https://github.com/max-te/mutant-report
mutation-testing rust
Last synced: about 2 months ago
JSON representation
HTML reports for cargo-mutants
- Host: GitHub
- URL: https://github.com/max-te/mutant-report
- Owner: max-te
- License: mit
- Created: 2024-03-10T15:45:54.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-10T16:38:30.000Z (over 2 years ago)
- Last Synced: 2025-06-11T20:38:25.776Z (about 1 year ago)
- Topics: mutation-testing, rust
- Language: TypeScript
- Homepage:
- Size: 469 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# HTML Report for `cargo-mutants`
This tool takes the results of [cargo-mutants](https://mutants.rs/) and displays them in a HTML report based on [Stryker Mutator](https://stryker-mutator.io/)'s [mutation-testing-elements](https://github.com/stryker-mutator/mutation-testing-elements/tree/master/packages/elements).
We convert the cargo-mutants output into a Stryker-compatible json format and vendor a modified version of mutation-testing-elements which supports Rust syntax highlighting.
## Building
To build this tool you need to have [bun](https://bun.sh) installed. Then, run:
```shell
$ bun install
$ bun compile
```
The result is an executable `dist/converter`.
## Usage
Run cargo-mutants on your Rust project. For test information in the report it is recommended to run the mutation tests with nextest and with the environment variables `NEXTEST_EXPERIMENTAL_LIBTEST_JSON=1 NEXTEST_MESSAGE_FORMAT=libtest-json`.
(Alternatively, if nextest is not an option, with `cargo +nightly mutants -- -- --format json -Z unstable-options`.)
You should have a `mutants.out` directory in your project folder.
Now, run the `converter serve` from the project folder. This will serve the report on port 3000.
Running only `converter` will output the report files (`report.json`, `report.html` and `mutant-report.js`) to `mutants.out`. Due to CORS restrictions, you need to serve them via HTTP to be useful.