-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi-test.config.ts
More file actions
33 lines (27 loc) · 929 Bytes
/
Copy pathapi-test.config.ts
File metadata and controls
33 lines (27 loc) · 929 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import dotenv from 'dotenv';
import path from 'path';
dotenv.config({ path: path.resolve(__dirname, '.env') });
const processENV = process.env.TEST_ENV
const env = processENV || 'staging';
console.log(`Running tests in ${env} environment`);
const config = {
apiBaseUrl: 'https://conduit-api.bondaracademy.com/api',
userEmail: 'learnerharisbd@gmail.com',
userPassword: 'H12345bd'
};
if (env === 'qa') {
config.userEmail = 'learnerharisbd@gmail.com';
config.userPassword = 'H12345bd';
}
if (env === 'staging') {
config.userEmail = 'learnerharisbd@gmail.com';
config.userPassword = 'H12345bd';
}
if (env === 'prod') {
if(!process.env.PROD_USERNAME || !process.env.PROD_PASSWORD){
throw new Error("Missing Environment variables for production environment");
}
config.userEmail = process.env.PROD_USERNAME;
config.userPassword = process.env.PROD_PASSWORD;
}
export { config };