Skip to content

Commit

Permalink
[1.x] Fix Pest test installation for Inertia stack (#279)
Browse files Browse the repository at this point in the history
* Fix installation of Inertia-specific Pest tests

* Add missing failure handler
  • Loading branch information
jessarcher authored Mar 28, 2023
1 parent 2f32826 commit bb2935f
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/Console/InstallsInertiaStacks.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,11 @@ protected function installInertiaVueStack()
return 1;
}

(new Filesystem)->copyDirectory(__DIR__.'/../../stubs/inertia-common/tests/Feature', base_path('tests/Feature'));
if ($this->option('pest')) {
(new Filesystem)->copyDirectory(__DIR__.'/../../stubs/inertia-common/pest-tests/Feature', base_path('tests/Feature'));
} else {
(new Filesystem)->copyDirectory(__DIR__.'/../../stubs/inertia-common/tests/Feature', base_path('tests/Feature'));
}

// Routes...
copy(__DIR__.'/../../stubs/inertia-common/routes/web.php', base_path('routes/web.php'));
Expand Down Expand Up @@ -247,8 +251,15 @@ protected function installInertiaReactStack()
}

// Tests...
$this->installTests();
(new Filesystem)->copyDirectory(__DIR__.'/../../stubs/inertia-common/tests/Feature', base_path('tests/Feature'));
if (! $this->installTests()) {
return 1;
}

if ($this->option('pest')) {
(new Filesystem)->copyDirectory(__DIR__.'/../../stubs/inertia-common/pest-tests/Feature', base_path('tests/Feature'));
} else {
(new Filesystem)->copyDirectory(__DIR__.'/../../stubs/inertia-common/tests/Feature', base_path('tests/Feature'));
}

// Routes...
copy(__DIR__.'/../../stubs/inertia-common/routes/web.php', base_path('routes/web.php'));
Expand Down

0 comments on commit bb2935f

Please sign in to comment.