From 079913d8a37306cb87a557f134dbcde4ff0c34e2 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Sun, 8 Dec 2024 14:11:57 +0100 Subject: [PATCH] Move up and improve test --- .../tests/Unit/Facades/ViteFacadeTest.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/framework/tests/Unit/Facades/ViteFacadeTest.php b/packages/framework/tests/Unit/Facades/ViteFacadeTest.php index 90c5e06481c..6c0cbfac33f 100644 --- a/packages/framework/tests/Unit/Facades/ViteFacadeTest.php +++ b/packages/framework/tests/Unit/Facades/ViteFacadeTest.php @@ -59,6 +59,15 @@ public function testRunningReturnsFalseWhenViteHotFileDoesNotExist() $this->assertFalse(Vite::running()); } + public function testAssetsMethodReturnsHtmlString() + { + $this->assertInstanceOf(HtmlString::class, Vite::assets([])); + $this->assertInstanceOf(HtmlString::class, Vite::assets(['foo.js'])); + + $this->assertEquals(new HtmlString(''), Vite::assets([])); + $this->assertEquals(new HtmlString(''), Vite::assets(['foo.js'])); + } + public function testAssetsMethodGeneratesCorrectHtmlForJavaScriptFiles() { $html = Vite::assets(['resources/js/app.js']); @@ -89,9 +98,4 @@ public function testAssetsMethodGeneratesCorrectHtmlForMultipleFiles() $this->assertSame($expected, (string) $html); } - - public function testAssetsMethodReturnsHtmlString() - { - $this->assertInstanceOf(HtmlString::class, Vite::assets([])); - } }