node-postgres/test/unit/connection/error-tests.js
2011-02-23 19:50:43 -06:00

11 lines
337 B
JavaScript

var helper = require(__dirname + '/test-helper');
var Connection = require('connection');
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!");
});