diff --git a/bin/pest b/bin/pest index d169f852..8de2b9de 100755 --- a/bin/pest +++ b/bin/pest @@ -3,6 +3,7 @@ use Pest\ConfigLoader; use Pest\Kernel; +use Pest\Panic; use Pest\TestCaseFilters\GitDirtyTestCaseFilter; use Pest\TestCaseMethodFilters\TodoTestCaseFilter; use Pest\TestSuite; @@ -85,11 +86,15 @@ use Symfony\Component\Console\Output\ConsoleOutput; $output = new ConsoleOutput(ConsoleOutput::VERBOSITY_NORMAL, $isDecorated); - $kernel = Kernel::boot($testSuite, $input, $output); + try { + $kernel = Kernel::boot($testSuite, $input, $output); - $result = $kernel->handle($args); + $result = $kernel->handle($args); - $kernel->shutdown(); + $kernel->shutdown(); + } catch (Throwable|Error $e) { + Panic::with($e); + } exit($result); })(); diff --git a/composer.json b/composer.json index ceebf09c..d531b48c 100644 --- a/composer.json +++ b/composer.json @@ -94,6 +94,7 @@ "Pest\\Plugins\\Help", "Pest\\Plugins\\Memory", "Pest\\Plugins\\Printer", + "Pest\\Plugins\\ProcessIsolation", "Pest\\Plugins\\Retry", "Pest\\Plugins\\Version", "Pest\\Plugins\\Parallel" diff --git a/src/Plugins/Parallel.php b/src/Plugins/Parallel.php index b85227d1..8f53801a 100644 --- a/src/Plugins/Parallel.php +++ b/src/Plugins/Parallel.php @@ -32,7 +32,7 @@ final class Parallel implements HandlesArguments /** * @var string[] */ - private const UNSUPPORTED_ARGUMENTS = ['--todo', '--retry']; + private const UNSUPPORTED_ARGUMENTS = ['--todos', '--retry']; /** * Whether the given command line arguments indicate that the test suite should be run in parallel. diff --git a/src/Plugins/ProcessIsolation.php b/src/Plugins/ProcessIsolation.php new file mode 100644 index 00000000..bf454b65 --- /dev/null +++ b/src/Plugins/ProcessIsolation.php @@ -0,0 +1,28 @@ +hasArgument('--process-isolation', $arguments)) { + throw new InvalidOption('The [--process-isolation] option is not supported.'); + } + + return $arguments; + } +} diff --git a/tests/Visual/Todo.php b/tests/Visual/Todo.php index 3a396a21..edf1bb4e 100644 --- a/tests/Visual/Todo.php +++ b/tests/Visual/Todo.php @@ -25,9 +25,9 @@ $snapshot = function ($name) { }; test('todo', function () use ($run, $snapshot) { - expect($run('--todo', false))->toContain($snapshot('todo')); + expect($run('--todos', false))->toContain($snapshot('todo')); })->skip(PHP_OS_FAMILY === 'Windows'); test('todo in parallel', function () use ($run, $snapshot) { - expect($run('--todo', true))->toContain($snapshot('todo')); + expect($run('--todos', true))->toContain($snapshot('todo')); })->skip(PHP_OS_FAMILY === 'Windows');