Skip to content

Commit

Permalink
Disconnect socket listener in tests
Browse files Browse the repository at this point in the history
Another exposed mistake thanks to Mocha's change to process killing
(I'm glad they made that change to be honest...)

The tests which created a SocketIO client to test opened captions were
passing, and then failing because after they ended the opened captions
server closed but the client was not disconnected first.  This change
disconnects the client before turning off the server.
  • Loading branch information
slifty committed Nov 15, 2018
1 parent 52f02fe commit 1479ed6
Show file tree
Hide file tree
Showing 2 changed files with 752 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/unit/openedcaptions.core.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@ describe('The opened captions constructor', function() {
var client = ioClient.connect('http://localhost:' + port);

client.on('connect', function() {
client.disconnect();
oc.close();
done();
});
client.on('connect_error', function(e) {
client.disconnect();
oc.close();
done(e)
});
Expand Down
Loading

0 comments on commit 1479ed6

Please sign in to comment.