Saturday, 15 April 2017

Verifying a node.js service startup behaviour with tests

I have a node.js app, that on startup, after a varied amount of time does some task (say A) and then listens to request. I want to verify (with tests) it successfully doing A on service start, and then waits for requests.

For each test I want to run a new instance of the service, the thing is that I can't know when the service is done with initializing itself for going on verifying it finished doing task A, as the process of the service doesn't get closed and still waits for other requests.

Using any kind of waiting will make the test unstable.

Thanks



via yuria

No comments:

Post a Comment