diff --git a/src/Plugins/Snapshot.php b/src/Plugins/Snapshot.php index 3f9cb850..262eadcc 100644 --- a/src/Plugins/Snapshot.php +++ b/src/Plugins/Snapshot.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Pest\Plugins; +use Pest\Exceptions\InvalidOption; use Pest\Contracts\Plugins\HandlesArguments; use Pest\TestSuite; @@ -23,6 +24,10 @@ final class Snapshot implements HandlesArguments return $arguments; } + if ($this->hasArgument('--parallel', $arguments)) { + throw new InvalidOption('The [--update-snapshots] option is not supported when running in parallel.'); + } + TestSuite::getInstance()->snapshots->flush(); return $this->popArgument('--update-snapshots', $arguments);