Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
nunomaduro committed Sep 9, 2024
1 parent 593d151 commit d6a137e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pest3-now-available.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,13 @@ Then, run Pest PHP with the `--mutate` option to start mutation testing.
Pest will then re-run your tests against "mutated" code and see if the tests are still passing. If a test is still passing against a mutation, it means that the test is not covering that specific part of the code. As, as result, Pest will output the mutation and the diff of the code.

```diff
UNCOVERED app/Http/TodoController.php > Line 44: UpdateReturnValue - ID: 76d17ad63bb7c307
UNTESTED app/Http/TodoController.php > Line 44: ReturnValue - ID: 76d17ad63bb7c307

class TodoController {
public function index(): array
{
// in your controller, pest will mutate this line returning an empty array instead of all todos...
// pest detected that this code is untested because
// the test is not covering the return value
- return Todo::all()->toArray();
+ return [];
}
Expand Down

0 comments on commit d6a137e

Please sign in to comment.