Created
September 2, 2013 17:30
-
-
Save incompl/6415311 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// tearDown is called after every test | |
// Shut down server and all clients | |
tearDown: function(callback) { | |
try { | |
_(clients).forEach(function(client) { | |
if (client.connected()) { | |
console.log('ending client'); | |
client.end(); | |
} | |
else { | |
console.log('client already disconnected'); | |
} | |
}); | |
clients = null; | |
console.log('stopping server'); | |
this.server.stop(function() { | |
console.log('server stopped'); | |
callback(); | |
}); | |
} | |
catch(e) { | |
console.error(e); | |
} | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment