title: What approach should be used to test a SocketIO Client app using Jest?
body: <p>I need to test a React Client app using SocketIO Client. I have searched various websites online but couldn't get any of their examples to work. I then installed Express on the client app as a dev dependency and tried to start a test server in the Jest test but couldn't get that to work. </p>
  
  <p>So I was wondering, in fact, what would be the right way to test this app anyway? </p>
  
  <p>My target is to test the following event listener registered in componentDidMount</p>
  
  <pre><code>componentDidMount() {
      const current_this = this;
      socket.on("numOfPlayersChanged", function(data) {
        // do something
      });
    }
  </code></pre>