Skip to content

Commit eafd8ec

Browse files
committed
test: separate dbconfig from datasource
1 parent de8f84d commit eafd8ec

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

test/init.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,15 @@ var url = 'postgres://' + (config.username || config.user) + ':' +
2121
config.password + '@' + (config.host || config.hostname) + ':' +
2222
config.port + '/' + config.database;
2323

24-
global.getDataSource = global.getSchema = function(useUrl) {
24+
global.getDBConfig = function(useUrl) {
2525
var settings = config;
2626
if (useUrl) {
2727
settings = {url: url};
28-
}
28+
};
29+
return settings;
30+
}
31+
global.getDataSource = global.getSchema = function(useUrl) {
32+
var settings = getDBConfig(useUrl);
2933
var db = new DataSource(require('../'), settings);
3034
db.log = function(a) {
3135
// console.log(a);

0 commit comments

Comments
 (0)