-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TASK] Add test coverage for css-only entrypoints
- Loading branch information
Showing
3 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"Main.scss": { | ||
"file": "assets/Main-4483b920.css", | ||
"isEntry": true, | ||
"src": "Main.scss" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Praetorius\ViteAssetCollector\Tests\Unit\Service; | ||
|
||
use PHPUnit\Framework\Attributes\DataProvider; | ||
use PHPUnit\Framework\Attributes\Test; | ||
use Praetorius\ViteAssetCollector\Domain\Model\ViteManifestItem; | ||
use TYPO3\TestingFramework\Core\Unit\UnitTestCase; | ||
|
||
final class ViteManifestItemTest extends UnitTestCase | ||
{ | ||
public static function isCssDataProvider(): array | ||
{ | ||
return [ | ||
'Main.js' => [ | ||
new ViteManifestItem('Main.js', 'Main.js', 'assets/Main-4483b920.js', true, false, [], [], [], []), | ||
false, | ||
], | ||
'Main.css' => [ | ||
new ViteManifestItem('Main.css', 'Main.css', 'assets/Main-4483b920.css', true, false, [], [], [], []), | ||
true, | ||
], | ||
'Main.scss' => [ | ||
new ViteManifestItem('Main.scss', 'Main.scss', 'assets/Main-4483b920.css', true, false, [], [], [], []), | ||
true, | ||
], | ||
]; | ||
} | ||
|
||
#[Test] | ||
#[DataProvider('isCssDataProvider')] | ||
public function isCss(ViteManifestItem $item, bool $expected): void | ||
{ | ||
self::assertEquals( | ||
$expected, | ||
$item->isCss() | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters