-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
101 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,14 @@ | ||
{ | ||
"demo.ts": { | ||
"file": "assets/index.deadbeef.js", | ||
"src": "demo.ts", | ||
"isEntry": true, | ||
"imports": [ | ||
"vendor.deadbeef.js" | ||
], | ||
"css": [] | ||
}, | ||
"vendor.deadbeef.js": { | ||
"file": "assets/vendor.deadbeef.js" | ||
} | ||
} |
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,11 @@ | ||
{ | ||
"demo.ts": { | ||
"file": "assets/index.deadbeef.js", | ||
"src": "demo.ts", | ||
"isEntry": true, | ||
"imports": [], | ||
"css": [ | ||
"assets/index.deadbeef.css" | ||
] | ||
} | ||
} |
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,38 @@ | ||
<?php | ||
|
||
use Idleberg\ViteManifest\ViteManifest; | ||
|
||
class ViteManifestEmptyCssTest extends \Codeception\Test\Unit | ||
{ | ||
/** | ||
* @var \UnitTester | ||
*/ | ||
protected $tester; | ||
protected $vm; | ||
protected $baseUrl = __DIR__ . "/../_data/"; | ||
protected $manifest = __DIR__ . "/../_data/manifest-empty-css.json"; | ||
|
||
protected function _before() | ||
{ | ||
$this->vm = new ViteManifest($this->manifest, $this->baseUrl); | ||
} | ||
|
||
protected function _after() | ||
{ | ||
// The void | ||
} | ||
|
||
// tests | ||
public function testGetManifest() | ||
{ | ||
$actual = $this->vm->getManifest(); | ||
$expected = json_decode('{"demo.ts":{"file":"assets/index.deadbeef.js","src":"demo.ts","isEntry":true,"imports":["vendor.deadbeef.js"],"css":[]},"vendor.deadbeef.js":{"file":"assets/vendor.deadbeef.js"}}', true); | ||
|
||
$this->assertEquals($actual, $expected); | ||
} | ||
|
||
public function testGetStyles() | ||
{ | ||
$this->assertEquals(count($this->vm->getStyles("demo.ts")), 0); | ||
} | ||
} |
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,38 @@ | ||
<?php | ||
|
||
use Idleberg\ViteManifest\ViteManifest; | ||
|
||
class ViteManifestEmptyImportsTest extends \Codeception\Test\Unit | ||
{ | ||
/** | ||
* @var \UnitTester | ||
*/ | ||
protected $tester; | ||
protected $vm; | ||
protected $baseUrl = __DIR__ . "/../_data/"; | ||
protected $manifest = __DIR__ . "/../_data/manifest-empty-imports.json"; | ||
|
||
protected function _before() | ||
{ | ||
$this->vm = new ViteManifest($this->manifest, $this->baseUrl); | ||
} | ||
|
||
protected function _after() | ||
{ | ||
// The void | ||
} | ||
|
||
// tests | ||
public function testGetManifest() | ||
{ | ||
$actual = $this->vm->getManifest(); | ||
$expected = json_decode('{"demo.ts":{"file":"assets/index.deadbeef.js","src":"demo.ts","isEntry":true,"imports":[],"css":["assets/index.deadbeef.css"]}}', true); | ||
|
||
$this->assertEquals($actual, $expected); | ||
} | ||
|
||
public function testGetImports() | ||
{ | ||
$this->assertEquals(count($this->vm->getImports("demo.ts")), 0); | ||
} | ||
} |