[Groonga-commit] groonga/express-kotoumi [master] test: Test registered listeners which shouldn't be called by replies

Back to archive index

YUKI Hiroshi null+****@clear*****
Wed Feb 13 18:44:28 JST 2013


YUKI Hiroshi	2013-02-13 18:44:28 +0900 (Wed, 13 Feb 2013)

  New Revision: c9134b43ff9bc1a8896cfbfdda349290dfc6d0b9
  https://github.com/groonga/express-kotoumi/commit/c9134b43ff9bc1a8896cfbfdda349290dfc6d0b9

  Log:
    test: Test registered listeners which shouldn't be called by replies

  Modified files:
    test/backend-connection.test.js

  Modified: test/backend-connection.test.js (+16 -0)
===================================================================
--- test/backend-connection.test.js    2013-02-13 18:42:03 +0900 (5954ef4)
+++ test/backend-connection.test.js    2013-02-13 18:44:28 +0900 (a48ea3d)
@@ -170,6 +170,11 @@ suite('Connection', function() {
     suite('request-response', function() {
       test('success', function(done) {
         var callback = createMockedMessageCallback();
+
+        // these events should not be emitted!
+        connection.on('first response', callback);
+        connection.on('second response', callback);
+
         var messages = [
           connection.emitMessage('first request', Math.random(), callback),
           connection.emitMessage('second request', Math.random(), callback)
@@ -212,6 +217,11 @@ suite('Connection', function() {
 
       test('error', function(done) {
         var callback = createMockedMessageCallback();
+
+        // these events should not be emitted!
+        connection.on('first response', callback);
+        connection.on('second response', callback);
+
         var messages = [
           connection.emitMessage('first request', Math.random(), callback),
           connection.emitMessage('second request', Math.random(), callback)
@@ -257,6 +267,12 @@ suite('Connection', function() {
 
       test('duplicated', function(done) {
         var callback = createMockedMessageCallback();
+
+        // these events should not be emitted!
+        connection.on('first response', callback);
+        connection.on('second response', callback);
+        connection.on('duplicated, ignored', callback);
+
         var messages = [
           connection.emitMessage('first request', Math.random(), callback),
           connection.emitMessage('second request', Math.random(), callback)
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index