Skip to content

Commit 142d84c

Browse files
committed
fix: ignore .env.testing file if it does not exist
- .env.testing is only required during local tests, especially for creating new snapshots, on ci it is not required
1 parent bd57daa commit 142d84c

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tests/Pest.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@
44
use FiveamCode\LaravelNotionApi\Tests\NotionApiTest;
55
use Illuminate\Support\Facades\Config;
66

7+
// uses(NotionApiTest::class)->in(__DIR__);
78
uses(NotionApiTest::class)->beforeEach(function () {
8-
$dotenv = Dotenv::createImmutable(__DIR__.'/..', '.env.testing');
9-
$dotenv->load();
10-
Config::set('laravel-notion-api.notion-api-token', env('NOTION_API_TOKEN'));
9+
if (file_exists(__DIR__ . '/../.env.testing')) {
10+
$dotenv = Dotenv::createImmutable(__DIR__ . '/..', '.env.testing');
11+
$dotenv->load();
12+
}
13+
Config::set('laravel-notion-api.notion-api-token', env('NOTION_API_TOKEN', ''));
1114
})->in(__DIR__);

0 commit comments

Comments
 (0)