diff --git a/src/Laravel/Commands/PestTestCommand.php b/src/Laravel/Commands/PestTestCommand.php index 55d9dc3a..5c6196a5 100644 --- a/src/Laravel/Commands/PestTestCommand.php +++ b/src/Laravel/Commands/PestTestCommand.php @@ -21,7 +21,7 @@ final class PestTestCommand extends Command * * @var string */ - protected $signature = 'pest:test {name : The name of the file} {--unit : Create a unit test} {--dusk : Create a Dusk test} {--test-directory=tests : The name of the tests directory}'; + protected $signature = 'pest:test {name : The name of the file} {--unit : Create a unit test} {--dusk : Create a Dusk test} {--test-directory=tests : The name of the tests directory} {--force : Force create}'; /** * The console command description. @@ -56,7 +56,7 @@ final class PestTestCommand extends Command File::makeDirectory(dirname($target), 0777, true, true); } - if (File::exists($target)) { + if (File::exists($target) and !$this->option('force')) { throw new InvalidConsoleArgument(sprintf('%s already exist', $target)); }