Instead of starting a real or fake server, you might consider just intercepting the HTTP request in your test and passing mocked data without it having to connect to a server.
For WWW::KeePassHttp, the module needs an HTTP server at the other end, and is using HTTP::Tiny to access that; for the test suite, I just mock the HTTP::Tiny::get() subroutine, and tell the fake-get what data to return to my module, so I can continue testing the module. (Basically, I just grabbed the HTTP responses from a live server, and saved those in my test script to be used for the mocked version.)
See, for example, https://github.com/pryrt/WWW-KeePassHttp/blob/main/t/workflow.t
In reply to Re: Waiting on an asynchronous call during a test
by pryrt
in thread Waiting on an asynchronous call during a test
by realflash
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |