Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
nunomaduro committed Sep 6, 2024
1 parent 4c21639 commit 8f5c91f
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/Plugins/Mutate.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@ public function addOutput(int $exitCode): int
$configurationRepository = Container::getInstance()->get(ConfigurationRepository::class);
$configuration = $configurationRepository->mergedConfiguration();

if ($configuration->classes === [] && ! $configuration->everything) {
$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:', '']);

$highlighter = new Highlighter;
Expand All @@ -170,7 +172,15 @@ public function addOutput(int $exitCode): int

$this->output->writeln($content);

$this->output->writeln(['', ' <bg=cyan> INFO </> Optionally, you can use the `pest --everything --covered-only` flags for generating mutations for "covered" classes, but this is not recommended as it will slow down the mutation testing process.', '']);
$this->output->writeln(['', ' <bg=cyan> INFO </> Optionally, you can use mutation testing with our filters:', '']);

$this->output->writeln([
' <fg=gray>pest --mutate --parallel --path=app/Models</>',
' <fg=gray>pest --mutate --parallel --class=App\\Models</>',
' <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.', '']);

return 1;
}
Expand Down

0 comments on commit 8f5c91f

Please sign in to comment.