Improves coverage feedback

This commit is contained in:
Nuno Maduro
2022-09-16 17:47:29 +01:00
parent 462982bb28
commit 3d5271f512
3 changed files with 34 additions and 2 deletions

View File

@ -87,6 +87,24 @@ final class Coverage implements AddsOutput, HandlesArguments
$this->coverageMin = (float) $minOption;
}
if (! \Pest\Support\Coverage::isAvailable()) {
if (\Pest\Support\Coverage::usingXdebug()) {
$this->output->writeln([
'',
" <fg=default;bg=red;options=bold> ERROR </> Unable to get coverage using Xdebug. Did you set <href=https://xdebug.org/docs/code_coverage#mode>Xdebug's coverage mode</>?</>",
'',
]);
} else {
$this->output->writeln([
'',
' <fg=default;bg=red;options=bold> ERROR </> No code coverage driver is available.</>',
'',
]);
}
exit(1);
}
return $originals;
}