Skip to content

Commit

Permalink
chore: specifies mutate
Browse files Browse the repository at this point in the history
  • Loading branch information
nunomaduro committed Sep 19, 2024
1 parent c46c13e commit 33782fe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@
],
"require": {
"php": "^8.2",
"nikic/php-parser": "^5.1.0",
"nikic/php-parser": "^5.2.0",
"pestphp/pest-plugin": "^3.0.0",
"psr/simple-cache": "^3.0.0"
},
"require-dev": {
"pestphp/pest": "^3.0.1",
"pestphp/pest": "^3.0.8",
"pestphp/pest-dev-tools": "^3.0.0",
"pestphp/pest-plugin-type-coverage": "^3.0.0"
},
Expand Down
5 changes: 3 additions & 2 deletions src/Plugins/Mutate.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,12 @@ public function addOutput(int $exitCode): int
$paths = $configurationRepository->cliConfiguration->toArray()['paths'] ?? false;

if (! is_array($paths) && $configuration->classes === [] && ! $configuration->everything) {
$this->output->writeln([' <bg=red> ERROR </> Mutation testing requires the usage of the `covers()` function. Here is an example:', '']);
$this->output->writeln([' <bg=red> ERROR </> Mutation testing requires the usage of the `covers()` function or `mutates()` function. Here is an example:', '']);

$highlighter = new Highlighter;
$content = $highlighter->highlight(<<<'PHP'
covers(TodoController::class); // mutations will be generated only for this class
// or mutates(TodoController::class);
it('list todos', function () {
// your test here...
Expand All @@ -180,7 +181,7 @@ public function addOutput(int $exitCode): int
' <fg=gray>pest --mutate --parallel --everything --covered-only</>',
]);

$this->output->writeln(['', ' However, we recommend using the `covers()` function for better performance, and keep tracking of your mutation testing score over time.']);
$this->output->writeln(['', ' However, we recommend using the `covers()` function or the `mutates` function for better performance, and keep tracking of your mutation testing score over time.']);

return 1;
}
Expand Down

0 comments on commit 33782fe

Please sign in to comment.