mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-28 22:01:33 +00:00
Update tests
This commit is contained in:
@@ -3,8 +3,30 @@
|
||||
namespace Tests;
|
||||
|
||||
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
|
||||
use Illuminate\Foundation\Vite as ViteManager;
|
||||
use Illuminate\Support\HtmlString;
|
||||
|
||||
abstract class TestCase extends BaseTestCase
|
||||
{
|
||||
use CreatesApplication; // Boot Laravel application for tests.
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
if (is_file(public_path('build/manifest.json'))) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->app->singleton(ViteManager::class, static fn (): ViteManager => new class extends ViteManager
|
||||
{
|
||||
/**
|
||||
* Avoid requiring compiled frontend assets while rendering Blade views in tests.
|
||||
*/
|
||||
public function __invoke($entrypoints, $buildDirectory = null): HtmlString
|
||||
{
|
||||
return new HtmlString('');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user