node does not exit when starting express server in uvu setup
See original GitHub issueI’ve got a uvu setup that seems fine apart from hanging after displaying test results.
In test.before()
I create two web servers, one using nodejs http module (is a simple git http server), and one for the app using express (and use test.after()
to close them down). Even though I can see both servers do shut down, uvu hangs after printing the test summary (with all tests passing) and I have to Ctrl-C.
I’m using the express server so I can use webpack-dev-middleware
to serve modules from memory without a full build. However, I can run without the express server when I’m doing a test on the build, because I don’t need the middleware for that.
So when I run a build test I don’t use the express server, but replace it with a nodejs server that serves the static build output. So in this case I have two nodejs http servers, one for the git http server and one for the app. This works fine and after passing all tests, uvu exits. So it seems to be to do with the express app or server.
I’m sure the server is closing, and have tried several modules that help close the running server if connections remain open. But inspecting the server object I can see there are no open connections, and the server does appear to have shut down correctly.
Do you have any experience of starting a server inside uvu tests, and particularly with express? I’m not sure it is a big enough issue to go into in depth (because I can just run an external server during development testing) but want to ask in case it’s an easy thing to solve. Thanks.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
Cool! uvu is short, easy to remember, and easy to type. The acronym for “ultimate velocity unleashed” was shoe horned after haha
Thank you so much, that works. And thanks for
uvu
(why ‘uvu’ by the way?).