-
-
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.
Call callback when end called on unconnected client (#2109)
* Call callback when end called on unconnected client Closes #2108 * Revert a bit of the change * Use readyState because pending doesn't exist in node 8.x * Update packages/pg/lib/client.js use bring your own promise Co-Authored-By: Charmander <~@charmander.me> Co-authored-by: Charmander <~@charmander.me>
- Loading branch information
1 parent
2987753
commit 1c8b6b9
Showing
2 changed files
with
22 additions
and
0 deletions.
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
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 @@ | ||
"use strict" | ||
var helper = require('./../test-helper') | ||
const suite = new helper.Suite() | ||
|
||
suite.test('Closing an unconnected client calls callback', (done) => { | ||
const client = new helper.pg.Client() | ||
client.end(done) | ||
}) | ||
|
||
suite.testAsync('Closing an unconnected client resolves promise', () => { | ||
const client = new helper.pg.Client() | ||
return client.end() | ||
}) |