mirror of
https://github.com/brianc/node-postgres.git
synced 2025-12-08 20:16:25 +00:00
added unit test for connection propagating stream errors
This commit is contained in:
parent
d2079478da
commit
6eea7b3c4f
10
test/unit/connection/error-tests.js
Normal file
10
test/unit/connection/error-tests.js
Normal file
@ -0,0 +1,10 @@
|
||||
var helper = require(__dirname + '/test-helper');
|
||||
|
||||
var con = new Connection({stream: new MemoryStream()});
|
||||
test("connection emits stream errors", function() {
|
||||
assert.emits(con, 'error', function(err) {
|
||||
assert.equal(err, "OMG!");
|
||||
});
|
||||
con.connect();
|
||||
con.stream.emit('error', "OMG!");
|
||||
});
|
||||
Loading…
x
Reference in New Issue
Block a user