mirror of
https://github.com/coollabsio/coolify.git
synced 2026-11-04 18:52:49 +00:00
test: centralize test configuration and add more guards to pest config
This commit is contained in:
2 files changed
+15
-13
No files matched your search
@@ -43,7 +43,6 @@ final class AppServiceProvider extends ServiceProvider
|
||||
$this->configureModels();
|
||||
$this->configureDates();
|
||||
$this->configureQueues();
|
||||
$this->configureTests();
|
||||
$this->configureRequestExceptions();
|
||||
$this->configureVite();
|
||||
}
|
||||
@@ -116,17 +115,6 @@ final class AppServiceProvider extends ServiceProvider
|
||||
Queue::withoutInterruptionPolling();
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure tests.
|
||||
*/
|
||||
private function configureTests(): void
|
||||
{
|
||||
if (App::runningUnitTests()) {
|
||||
Sleep::fake();
|
||||
Http::preventStrayRequests();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure request exceptions.
|
||||
*/
|
||||
|
||||
+15
-1
@@ -3,6 +3,10 @@
|
||||
declare(strict_types=1);
|
||||
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Support\Facades\Process;
|
||||
use Illuminate\Support\Sleep;
|
||||
use Illuminate\Support\Str;
|
||||
use Tests\TestCase;
|
||||
|
||||
/*
|
||||
@@ -17,7 +21,17 @@ use Tests\TestCase;
|
||||
*/
|
||||
|
||||
pest()->extend(TestCase::class)
|
||||
->use(RefreshDatabase::class);
|
||||
->use(RefreshDatabase::class)
|
||||
->beforeEach(function (): void {
|
||||
Str::createRandomStringsNormally();
|
||||
Str::createUuidsNormally();
|
||||
Str::createUlidsNormally();
|
||||
Http::preventStrayRequests();
|
||||
Process::preventStrayProcesses();
|
||||
Sleep::fake();
|
||||
|
||||
$this->freezeTime();
|
||||
});
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
||||
Reference in new issue
Block a user