Skip to content

Commit 4d6ba2d

Browse files
committed
updated config.ts file
1 parent d15063b commit 4d6ba2d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

utils/config.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import * as dotenv from 'dotenv';
2-
import * as path from 'path';
1+
import * as dotenvFlow from 'dotenv-flow';
32

4-
// Determine the environment (default to 'local' if not provided)
53
const envName = process.env.TEST_ENV || 'local';
64
console.log("Environment Name is: " + envName);
75

8-
// Load the corresponding .env file from /env folder
9-
console.log(`../../env/.env.${envName}`);
10-
dotenv.config({ path: path.resolve(__dirname, `../env/.env.${envName}`) });
6+
// Load .env files using dotenv-flow
7+
dotenvFlow.config({
8+
node_env: envName, // This will load .env.qa1, .env.dev, etc.
9+
path: `${__dirname}/../env`
10+
});
1111

1212
interface TestConfig {
1313
url: string;

0 commit comments

Comments
 (0)