Skip to content

Commit

Permalink
Fix event filtering callbacks in tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
marshallswain committed Feb 17, 2015
1 parent c4edd86 commit 08f347a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
11 changes: 3 additions & 8 deletions test/providers/primus.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ describe('Primus provider', function () {
return callback(null, data);
}

callback();
callback(null, false);
};

socket.send('todo::remove', 1, {}, function() {});
Expand Down Expand Up @@ -432,21 +432,16 @@ describe('Primus provider', function () {
return callback(null, data);
}

callback();
callback(null, false);
};

socket.send('tasks::remove', 1, {}, function() {});
socket.send('tasks::remove', 23, {}, function() {});

var ready = false;

socket.on('tasks removed', function (data) {
service.removed = oldRemoved;
assert.equal(data.id, 23);
if (ready) {
done();
}
ready = true;
done();
});
});
});
Expand Down
11 changes: 3 additions & 8 deletions test/providers/socketio.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ describe('SocketIO provider', function () {
return callback(null, data);
}

callback();
callback(null, false);
};

socket.emit('todo::remove', 1, {}, function() {});
Expand Down Expand Up @@ -431,21 +431,16 @@ describe('SocketIO provider', function () {
return callback(null, data);
}

callback();
callback(null, false);
};

socket.emit('tasks::remove', 1, {}, function() {});
socket.emit('tasks::remove', 23, {}, function() {});

var ready = false;

socket.on('tasks removed', function (data) {
service.removed = oldRemoved;
assert.equal(data.id, 23);
if (ready) {
done();
}
ready = true;
done();
});
});
});
Expand Down

0 comments on commit 08f347a

Please sign in to comment.