From 6eea7b3c4f01f47efbdce6cd5e069102ed1cd342 Mon Sep 17 00:00:00 2001 From: brianc Date: Sun, 31 Oct 2010 14:49:49 -0500 Subject: [PATCH] added unit test for connection propagating stream errors --- test/unit/connection/error-tests.js | 10 ++++++++++ test/unit/prepared-query-tests.js | 0 2 files changed, 10 insertions(+) create mode 100644 test/unit/connection/error-tests.js delete mode 100644 test/unit/prepared-query-tests.js diff --git a/test/unit/connection/error-tests.js b/test/unit/connection/error-tests.js new file mode 100644 index 00000000..fb9f1b50 --- /dev/null +++ b/test/unit/connection/error-tests.js @@ -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!"); +}); diff --git a/test/unit/prepared-query-tests.js b/test/unit/prepared-query-tests.js deleted file mode 100644 index e69de29b..00000000