Permalink
Browse files

Cleanup request subid test - only schedule termintation sequence once.

  • Loading branch information...
1 parent f5b48f2 commit a57a07c883f471327c2dd400fd4c9f4bafcffd15 @jvoorhis committed Feb 28, 2012
Showing with 8 additions and 6 deletions.
  1. +8 −6 test/basics.js
View
@@ -111,14 +111,16 @@ describe('Basics', function() {
});
var sub = nc.request('foo', initMsg, function(reply) {
+ if (0 == received) {
+ setTimeout(function() {
+ received.should.equal(expected);
+ nc.close();
+ done();
+ }, 0);
+ }
+
received += 1;
nc.unsubscribe(sub);
-
- setTimeout(function() {
- received.should.equal(expected);
- nc.close();
- done();
- }, 0);
});
});

0 comments on commit a57a07c

Please sign in to comment.