I need to generate a Jest coverage report for the ExpressJS server application that supports HTTP and WebSocket connections. I have a file with tests: server.test.js that imports a few classes for doing HTTP/WebSocket requests and sends those requests to the Express app. Whenever I run jest --coverage path/to/the/dir/with/tests I get only the coverage report for those files that are used by server.test.js (the ones that I import into the test file). But how can I also generate the coverage report for all the code which gets executed on the server when requests sent from server.test.js hit the respective endpoints?
A small note is that the server is on the same machine, in the directory next to the one with tests.
Any help will be appreciated