mirror of
https://github.com/brianc/node-postgres.git
synced 2025-12-08 20:16:25 +00:00
emit error object from memory stream
This commit is contained in:
parent
21b597ef17
commit
67a2290f30
@ -3,8 +3,8 @@ var Connection = require(__dirname + '/../../../lib/connection');
|
||||
var con = new Connection({stream: new MemoryStream()});
|
||||
test("connection emits stream errors", function() {
|
||||
assert.emits(con, 'error', function(err) {
|
||||
assert.equal(err, "OMG!");
|
||||
assert.equal(err.message, "OMG!");
|
||||
});
|
||||
con.connect();
|
||||
con.stream.emit('error', "OMG!");
|
||||
con.stream.emit('error', new Error("OMG!"));
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user