Skip to content

Commit 471c9ed

Browse files
committed
refactor(config): remove use of test-only member in EnvironmentConfig
Removes the iteration over `_env.map` to resolve an `invalid_use_of_visible_for_testing_member` warning. The `.map` getter in the `dotenv` package is intended for testing only. This change respects the dependency's API contract, making the configuration loading more robust and removing the lint warning. The error message for a missing `DATABASE_URL` remains clear and actionable.
1 parent 885379e commit 471c9ed

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

lib/src/config/environment_config.dart

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,7 @@ abstract final class EnvironmentConfig {
2424
static String get databaseUrl {
2525
final dbUrl = _env['DATABASE_URL'];
2626
if (dbUrl == null || dbUrl.isEmpty) {
27-
_log.severe(
28-
'DATABASE_URL not found. Dumping available environment variables:',
29-
);
30-
_env.map.forEach((key, value) {
31-
_log.severe(' - $key: $value');
32-
});
27+
_log.severe('DATABASE_URL not found in environment variables.');
3328
throw StateError(
3429
'FATAL: DATABASE_URL environment variable is not set. '
3530
'The application cannot start without a database connection.',

0 commit comments

Comments
 (0)