I\'m using the mock-socket package to test some websocket connection based code. I close the mocks server by mockServer.stop() which closes the client
mock-socket
mockServer.stop()