Skip to content

Commit f6d8821

Browse files
ssh24gregdingle
authored andcommitted
Fix unit tests
1 parent f7a9954 commit f6d8821

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

test/postgresql.initialization.test.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
var connector = require('..');
99
var DataSource = require('loopback-datasource-juggler').DataSource;
1010
var should = require('should');
11+
var db;
12+
13+
before(function() {
14+
db = getDBConfig();
15+
});
1116

1217
describe('initialization', function() {
1318
it('honours user-defined pg-pool settings', function() {
@@ -22,7 +27,8 @@ describe('initialization', function() {
2227
});
2328

2429
it('honours user-defined url settings', function() {
25-
var settings = {url: 'postgres://'};
30+
var settings = {url: 'postgres://' + db.username + ':' + db.password + '@' +
31+
db.host + ':' + db.port + '/' + db.database};
2632

2733
var dataSource = new DataSource(connector, {});
2834
var clientConfig = dataSource.connector.clientConfig;
@@ -34,7 +40,8 @@ describe('initialization', function() {
3440
});
3541

3642
it('honours multiple user-defined settings', function() {
37-
var settings = {url: 'postgres://', max: 999};
43+
var settings = {url: 'postgres://' + db.username + ':' + db.password + '@' +
44+
db.host + ':' + db.port + '/' + db.database, max: 999};
3845

3946
var dataSource = new DataSource(connector, settings);
4047
var pool = dataSource.connector.pg.pool;

0 commit comments

Comments
 (0)