mirror of
https://github.com/brianc/node-postgres.git
synced 2025-12-08 20:16:25 +00:00
added test for failing connection
This commit is contained in:
parent
2e2aa0083b
commit
dde73c68d7
@ -12,9 +12,16 @@ test('calling connect without params raises error', function() {
|
||||
assert.ok(err!=null);
|
||||
});
|
||||
|
||||
test('connecting with wrong parameters', function() {
|
||||
var con = new Connection();
|
||||
con.connect("user=asldfkj hostaddr=127.0.0.1 port=5432 dbname=asldkfj");
|
||||
assert.emits(con, 'error')
|
||||
});
|
||||
|
||||
|
||||
test('connects', function() {
|
||||
var con = new Connection();
|
||||
con.connect("user=postgres password=1234 hostaddr=127.0.0.1 port=5432 dbname=postgres");
|
||||
con.connect("user=brian hostaddr=127.0.0.1 port=5432 dbname=postgres");
|
||||
assert.emits(con, 'connect', function() {
|
||||
con._sendQuery("SELECT NOW()");
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user