Skip to content

Commit 8f9d690

Browse files
committed
ensure .env.testing is loaded for config
- load `NOTION_API_TOKEN` - important for later tests
1 parent aa67de9 commit 8f9d690

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/Pest.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
<?php
22

3+
use Dotenv\Dotenv;
34
use FiveamCode\LaravelNotionApi\Tests\NotionApiTest;
5+
use Illuminate\Support\Facades\Config;
46

5-
uses(NotionApiTest::class)->in(__DIR__);
7+
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'));
11+
})->in(__DIR__);

0 commit comments

Comments
 (0)