The sleep-based testing scenario is quite unreliable, especially in slow machines (See: https://github.com/kata-ai/merapi-proxy/blob/6f6f81d23c6c6e1fbf4910e7e1cd6f12ec01076e/test/async_test.spec.js#L103). Callback/promise-based is going to be more robust in this case.
The sleep-based testing scenario is quite unreliable, especially in slow machines (See: https://github.com/kata-ai/merapi-proxy/blob/6f6f81d23c6c6e1fbf4910e7e1cd6f12ec01076e/test/async_test.spec.js#L103).
Callback/promise-based is going to be more robust in this case.