-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make pool name consistent on missing config params (#1279)
* Going red: using a config object creates two pools when missing some params It should only create a pool in a consistent way, even if some params are not provided in the first place. * Delay the pool name generation to make it consistent between calls * Don't fallback to empty object as config is already defined
- Loading branch information
Showing
2 changed files
with
14 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
test/integration/connection-pool/single-pool-on-object-config-tests.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
var helper = require(__dirname + "/../test-helper"); | ||
var pg = require(__dirname + "/../../../lib"); | ||
|
||
pg.connect(helper.config, assert.success(function(client, done) { | ||
assert.equal(Object.keys(pg._pools).length, 1); | ||
pg.connect(helper.config, assert.success(function(client2, done2) { | ||
assert.equal(Object.keys(pg._pools).length, 1); | ||
|
||
done(); | ||
done2(); | ||
pg.end(); | ||
})); | ||
})); |