Skip to content
This repository has been archived by the owner on Apr 24, 2020. It is now read-only.

Commit

Permalink
Fix monitor test (#566)
Browse files Browse the repository at this point in the history
  • Loading branch information
lgeiger authored and Ron Korving committed Sep 28, 2016
1 parent f08b472 commit 8d68519
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions test/socket.monitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ describe('socket.monitor', function() {

it('should be able to monitor the socket', function(done) {
var rep = zmq.socket('rep')
, req = zmq.socket('req')
, events = [];
, req = zmq.socket('req');

rep.on('message', function(msg){
msg.should.be.an.instanceof(Buffer);
Expand All @@ -25,14 +24,10 @@ describe('socket.monitor', function() {
// Test the endpoint addr arg
event_endpoint_addr.toString().should.equal('tcp://127.0.0.1:5423');

// If this is a disconnect event we can now close the rep socket
if (e === 'disconnect') {
rep.close();
}

testedEvents.pop();
if (testedEvents.length === 0) {
rep.unmonitor();
rep.close();
done();
}
});
Expand Down

0 comments on commit 8d68519

Please sign in to comment.