Skip to content

Commit d57b0b5

Browse files
committed
feat: add support for loading test environment variables in loadEnvFile.ts
1 parent b1c5ac9 commit d57b0b5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/loadEnvFile.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,9 @@ if (nodeEnv === 'production') {
4646
// Required for DISCORD_TOKEN and other secrets
4747
const localEnvFile = join(process.cwd(), '.env');
4848
loadEnvFile(localEnvFile);
49+
50+
if (nodeEnv === 'test') {
51+
console.log('🧪 Loading test environment variables');
52+
const testEnvFile = join(process.cwd(), '.env.test');
53+
loadEnvFile(testEnvFile);
54+
}

0 commit comments

Comments
 (0)