[Groonga-commit] groonga/express-droonga at 587c595 [master] test: remove wait()

Back to archive index

Kouhei Sutou null+****@clear*****
Sun Jul 21 20:12:48 JST 2013


Kouhei Sutou	2013-07-21 20:12:48 +0900 (Sun, 21 Jul 2013)

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

  Message:
    test: remove wait()

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

  Modified: test/backend/connection.test.js (+8 -7)
===================================================================
--- test/backend/connection.test.js    2013-07-21 19:59:07 +0900 (90416e3)
+++ test/backend/connection.test.js    2013-07-21 20:12:48 +0900 (04dd32e)
@@ -424,14 +424,15 @@ suite('Connection', function() {
     });
 
     test('normal messaging', function(done) {
-      connection.emitMessage({ message: true });
-      Deferred
-        .wait(0.01)
+      var deferred = new Deferred();
+      connection.emitMessage('type', { message: true });
+      backend.once('receive', function() {
+        deferred.call();
+      });
+      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(backend.getEvents(),
+                           ['type']);
           done();
         })
         .error(function(error) {
-------------- next part --------------
HTML����������������������������...
Download 



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