diff --git a/src/Vite.php b/src/Vite.php index 12721fa..6de13a3 100644 --- a/src/Vite.php +++ b/src/Vite.php @@ -205,7 +205,7 @@ protected function shouldUseManifest(): bool return false; } - if (! App::environment('local')) { + if (! App::environment(['local', 'testing'])) { return true; } diff --git a/tests/Unit/ViteTest.php b/tests/Unit/ViteTest.php index 4f96b39..c765c1d 100644 --- a/tests/Unit/ViteTest.php +++ b/tests/Unit/ViteTest.php @@ -125,6 +125,7 @@ Config::set('vite.entrypoints', 'scripts'); App::setBasePath(__DIR__); + set_env('production'); expect(get_vite()->getClientAndEntrypointTags()) ->toEqual(''); }); @@ -136,6 +137,7 @@ 'https://cdn.random.url' )); + set_env('production'); expect(vite_asset('image.png'))->toBe('https://cdn.random.url/build/image.png'); });