Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fb0956e

Browse files
committed
[finished] configuring testing database
1 parent 05aa372 commit fb0956e

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

.travis.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,10 @@ services:
1212
env:
1313
global:
1414
- NODE_ENV=test
15-
- DB_USER_test=teamwork_user
16-
- DB_PASSWORD_test=teamwork_password
17-
- DB_HOST_test=localhost
18-
- DB_PORT_test=5432
19-
- DB_DATABASE_test=teamwork_api_test
15+
- DATABASE_URL_TEST=postgres://utpwsugatpqjzn:03120a462667a671da3979385da1b5650ab8082d1319630013ec707eb7338ca5@ec2-54-225-173-42.compute-1.amazonaws.com:5432/ddo2ssbhau003c
2016
- SECRET=teamwork-api-secret-key
2117

2218
before_script:
23-
- psql -c 'create database teamwork_api_test;' -U postgres
24-
- psql -c "CREATE USER teamwork_user WITH PASSWORD 'teamwork_password';" -U postgres
25-
- psql -U teamwork_user -d teamwork_api_test -a -f ./init.sql
2619
- npm run build
2720
script:
2821
- npm test

api/v1/config/dbConfig.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ if (isProduction) {
1212
} else if (isDevelopment) {
1313
conn = `postgresql://${process.env.DB_USER}:${process.env.DB_PASSWORD}@${process.env.DB_HOST}:${process.env.DB_PORT}/${process.env.DB_DATABASE}`;
1414
} else {
15-
conn = `postgresql://${process.env.DB_USER_TEST}:${process.env.DB_PASSWORD_TEST}@${process.env.DB_HOST}:${process.env.DB_PORT}/${process.env.DB_DATABASE_TEST}`;
15+
conn = process.env.DATABASE_URL_TEST;
1616
}
1717

1818
const pool = new Pool({

0 commit comments

Comments
 (0)