Skip to content

Commit

Permalink
Fix test order
Browse files Browse the repository at this point in the history
  • Loading branch information
jondubois committed Feb 14, 2018
1 parent aa9197d commit f0f3676
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions test/integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -695,24 +695,6 @@ describe('integration tests', function () {
});
});

it('should destroy all references of socket when socketClusterClient.destroy(socket) is called', function (done) {
client = socketClusterClient.create(clientOptions);

var clientError;
client.on('error', function (err) {
clientError = err;
});

assert.equal(Object.keys(socketClusterClient.clients).length, 1);
assert.equal(socketClusterClient.clients[client.clientId] === client, true);

socketClusterClient.destroy(client);

assert.equal(Object.keys(socketClusterClient.clients).length, 0);
assert.equal(socketClusterClient.clients[client.clientId], null);
done();
});

it('should destroy all references of multiplexed socket when socket.destroy() is called', function (done) {
clientOptions.multiplex = true;
clientA = socketClusterClient.create(clientOptions);
Expand All @@ -739,5 +721,23 @@ describe('integration tests', function () {
assert.equal(socketClusterClient.clients[clientA.clientId], null);
done();
});

it('should destroy all references of socket when socketClusterClient.destroy(socket) is called', function (done) {
client = socketClusterClient.create(clientOptions);

var clientError;
client.on('error', function (err) {
clientError = err;
});

assert.equal(Object.keys(socketClusterClient.clients).length, 1);
assert.equal(socketClusterClient.clients[client.clientId] === client, true);

socketClusterClient.destroy(client);

assert.equal(Object.keys(socketClusterClient.clients).length, 0);
assert.equal(socketClusterClient.clients[client.clientId], null);
done();
});
});
});

0 comments on commit f0f3676

Please sign in to comment.