hoxy
hoxy copied to clipboard
staticServer in Cycle is never being closed.
I've been trying to use hoxy for testing a webpage using jest framework. Everytime I run it my testing framework refuses to quit warning me that there's an open handle. I've traced this back to the staticServer in cycle. That server is being created as soon as hoxy is loaded and there are no references to it so I can close it after I'm done using hoxy in runtime. There might be couple of solutions for dealing with this:
- Expose staticServer as an export form lib/cycle so I can import it as
import { staticServer } from 'hoxy/lib/cycle
and then stop it withstaticServer.close()
; - Make it part of the Cycle class so for every Cycle instance it gets initialized and accessible to outside. Through that Proxy object can access and kill it during the
close
call.