[Groonga-commit] groonga/express-droonga at f72d73f [master] test: compare messages length and content at a time

Back to archive index

Kouhei Sutou null+****@clear*****
Sat Jul 20 23:36:49 JST 2013


Kouhei Sutou	2013-07-20 23:36:49 +0900 (Sat, 20 Jul 2013)

  New Revision: f72d73f91391fc439276ed47fafb3e16bd9925fd
  https://github.com/groonga/express-droonga/commit/f72d73f91391fc439276ed47fafb3e16bd9925fd

  Message:
    test: compare messages length and content at a time

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

  Modified: test/backend-connection.test.js (+9 -5)
===================================================================
--- test/backend-connection.test.js    2013-07-20 23:30:30 +0900 (48f9356)
+++ test/backend-connection.test.js    2013-07-20 23:36:49 +0900 (01ba6c8)
@@ -417,6 +417,13 @@ suite('Connection', function() {
       }
     });
 
+    function extractTags(messages) {
+      return messages.map(function(message) {
+        var tag = message[0];
+        return tag;
+      });
+    };
+
     test('normal messaging', function(done) {
       connection.emitMessage({ message: true });
       Deferred
@@ -446,11 +453,8 @@ suite('Connection', function() {
           return deferred;
         })
         .next(function() {
-          assert.equal(backend.received.length,
-                       1,
-                       'message should be sent: ' + JSON.stringify(backend.received));
-          assert.equal(backend.received[0][0], 'test.message');
-
+          assert.deepEqual(extractTags(backend.received),
+                           ['test.message']);
           backend.close();
         })
         .wait(0.01)
-------------- next part --------------
HTML����������������������������...
Download 



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