YUKI Hiroshi
null+****@clear*****
Tue Mar 18 16:06:17 JST 2014
YUKI Hiroshi 2014-03-18 16:06:17 +0900 (Tue, 18 Mar 2014) New Revision: a9063f0df985f422042d52a2183d8b21e0a39a24 https://github.com/droonga/express-droonga/commit/a9063f0df985f422042d52a2183d8b21e0a39a24 Message: Assert errors from disconnected conneection Modified files: test/droonga-protocol/connection.test.js Modified: test/droonga-protocol/connection.test.js (+6 -0) =================================================================== --- test/droonga-protocol/connection.test.js 2014-03-18 16:05:58 +0900 (aa85e4b) +++ test/droonga-protocol/connection.test.js 2014-03-18 16:06:17 +0900 (58c7810) @@ -503,6 +503,7 @@ suite('Connection', function() { }); test('disconnected suddenly', function(done) { + var lastError = null; Deferred .next(function() { var deferred = new Deferred(); @@ -525,6 +526,7 @@ suite('Connection', function() { var deferred = new Deferred(); connection.on('error', function(error) { + lastError = error deferred.call(); }); @@ -532,6 +534,10 @@ suite('Connection', function() { return deferred; }) + .next(function() { + assert.isNotNull(lastError); + assert.equal(lastError.code, 'ECONNREFUSED'); + }) .createBackend() .next(function(newBackend) { restartedBackend = newBackend; -------------- next part -------------- HTML����������������������������... Download