diff --git a/tests/ViewFunctions/ViteTest.php b/tests/ViewFunctions/ViteTest.php new file mode 100644 index 0000000..ed910a9 --- /dev/null +++ b/tests/ViewFunctions/ViteTest.php @@ -0,0 +1,43 @@ +container->set('asset_path', $this->filePath('.')); + + $vite = $this->container->get(Vite::class); + + $tags = $vite(['app/resources/js/app.js', 'app/resources/css/app.css']); + + $this->assertSame(<< + + + HTML, $tags); + } + + #[Test] + public function it_can_get_tags_for_a_list_of_assets_when_in_build_mode(): void + { + $this->container->set('assets_path', $this->filePath('app/assets')); + + $vite = $this->container->get(Vite::class); + + $tags = $vite(['app/resources/js/app.js', 'app/resources/css/app.css']); + + $this->assertSame(<< + + HTML, $tags); + } +} diff --git a/tests/_files/app/assets/manifest.json b/tests/_files/app/assets/manifest.json new file mode 100644 index 0000000..d9fa526 --- /dev/null +++ b/tests/_files/app/assets/manifest.json @@ -0,0 +1,13 @@ +{ + "app/resources/css/app.css": { + "file": "app/assets/app-DcdLJcW2.css", + "src": "app/resources/css/app.css", + "isEntry": true + }, + "app/resources/js/app.js": { + "file": "app/assets/app-DwN9UvfZ.js", + "name": "app", + "src": "app/resources/js/app.js", + "isEntry": true + } +} diff --git a/tests/_files/app/assets/mix-manifest.json b/tests/_files/app/assets/mix-manifest.json deleted file mode 100644 index 64b8086..0000000 --- a/tests/_files/app/assets/mix-manifest.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "/app.css": "/app.css?id=417c7a9bc03852aafb27", - "/app.js": "/app.js?id=6753a7269276c7b52692" -}