I want to write a tester that will test a http server I wrote for class. and I need a synchronous version of http.get/http.post
I wanted to make an object with a "test" method that will return true or false if the test passed but found no way to get the code to wait until the server responds to the get request.
Any suggestions on how this can be done?
You can't do this with Node.js without horrible, busy-waiting hacks. Make your test
method asynchronous as well, calling a callback parameter to deliver the results of the test back to the caller. Or use a different language for your unit testing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With