chai-http icon indicating copy to clipboard operation
chai-http copied to clipboard

Please expose a cleanup method so that I can teardown my tests properly.

Open Jhorlin opened this issue 9 years ago • 1 comments

I am running into a common gulp-mocha issue where gulp cli completes executing all the tasks but it does not exit. This is because request creates a server when using a middleware app, but does not expose a method to destroy the procces and close the service. Since gulp cli listens for process exit event and request has created a service that is still listening the process exit event is not emitted.

Jhorlin avatar Jun 13 '15 04:06 Jhorlin

This is now the default behaviour in mocha 4 as well. It caused my tests to hang. In mocha there's currently a CLI flag to revert to the old behaviour, but I wouldn't count on this being the case indefinitely.

Exposing a cleanup or close method on the server returned by chai.request would be really useful.

wdullaer avatar Oct 03 '17 16:10 wdullaer