blob: 5a05764ff9e494dd4f22e8ecdc098be42d002049 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
<?php
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'));
});
|