Skip to content

Commit

Permalink
feat: --exactly
Browse files Browse the repository at this point in the history
  • Loading branch information
nunomaduro committed Dec 1, 2024
1 parent bfffb4d commit 17071be
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test-coverage.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ If there are any uncovered lines in your current test suite, they will be highli

## Minimum Threshold Enforcement

To ensure comprehensive testing and maintain code quality, it is crucial to set minimum threshold values for coverage results. In Pest, you can use the `--coverage` and `--min` options to define the minimum threshold values for coverage results. If the specified thresholds are not met, Pest will report a failure.
To ensure comprehensive testing and maintain code quality, it is crucial to set minimum threshold values for coverage results. In Pest, you can use the `--coverage` and `--min` or `--exactly` options to define the minimum threshold values for coverage results. If the specified thresholds are not met, Pest will report a failure.

```bash
./vendor/bin/pest --coverage --min=90
Expand All @@ -50,6 +50,12 @@ To ensure comprehensive testing and maintain code quality, it is crucial to set
<img src="/assets/img/coverage-min.webp?1" style="--lines: 9" />
</div>

Or, you can use the `--exactly` option to enforce that the coverage results match the specified value exactly.

```bash
./vendor/bin/pest --coverage --exactly=99.3
```

## Ignoring Code

If there are certain sections of your application that cannot be tested and should be excluded from code coverage analysis, you can use `@codeCoverageIgnoreStart` and `@codeCoverageIgnoreEnd` comments in your source code to achieve this.
Expand Down

0 comments on commit 17071be

Please sign in to comment.