Skip to content

Commit bc8b863

Browse files
committed
feat(tests): configure Unit tests, use LazilyRefreshDatabase instead
fix: vite error in tests
1 parent 9a28884 commit bc8b863

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

tests/Pest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,13 @@
1414
*/
1515

1616
pest()->extend(\Tests\TestCase::class)
17-
->use(\Illuminate\Foundation\Testing\RefreshDatabase::class)
17+
->use(\Illuminate\Foundation\Testing\LazilyRefreshDatabase::class)
1818
->in('Feature');
1919

20+
pest()->extend(\Tests\TestCase::class)
21+
->use(\Illuminate\Foundation\Testing\LazilyRefreshDatabase::class)
22+
->in('Unit');
23+
2024
/*
2125
|--------------------------------------------------------------------------
2226
| Expectations

tests/TestCase.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,17 @@
55
namespace Tests;
66

77
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
8+
use Illuminate\Support\Facades\Config;
89

910
abstract class TestCase extends BaseTestCase
1011
{
11-
//
12+
protected function setUp(): void
13+
{
14+
parent::setUp();
15+
16+
$this->withoutVite(); // Fake Vite for tests - for GH Actions
17+
18+
Config::set('filesystems.disks.public.root', storage_path('app/public_test'));
19+
Config::set('filesystems.disks.local.root', storage_path('app/private_test'));
20+
}
1221
}

0 commit comments

Comments
 (0)