summaryrefslogtreecommitdiff
path: root/tests/Feature
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Feature')
-rw-r--r--tests/Feature/ManifestTest.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/Feature/ManifestTest.php b/tests/Feature/ManifestTest.php
index a9e1108..5a05764 100644
--- a/tests/Feature/ManifestTest.php
+++ b/tests/Feature/ManifestTest.php
@@ -2,6 +2,32 @@
use Lightscale\LaralightAssets\Manifest;
+$path = fn() => public_path('dist/manifest.json');
+
it('instantiates', function() {
new Manifest('test.json', '/dist');
})->throwsNoExceptions();
+
+it('generates dir from file', function() use ($path) {
+ $manifest = new Manifest($path(), '/dist');
+ expect($manifest->getDir())
+ ->toBe(public_path('/dist'));
+});
+
+it('gets file', function() use ($path) {
+ $manifest = new Manifest($path(), '/dist');
+ expect($manifest->getFile('main.css'))
+ ->toBe('main.testing.css');
+});
+
+it('gets url', function() use ($path) {
+ $manifest = new Manifest($path(), '/dist');
+ expect($manifest->getUrl('main.css'))
+ ->toBe(asset('/dist/main.testing.css'));
+});
+
+it('gets paths', function() use ($path) {
+ $manifest = new Manifest($path(), '/dist');
+ expect($manifest->getPath('main.css'))
+ ->toBe(public_path('/dist/main.testing.css'));
+});