title: Testing long running tasks in NodeJS
body: <p>I have some long running tasks for my NodeJS project, and I'm building a RESTful interface over the project.</p>
  
  <p>I want to test that my REST interface can continue to be accessed, providing status updates while the longer running tasks are executing.</p>
  
  <p>In a multi threaded environment this is easy to test because you just put one thread to sleep for a period of time because your HTTP controller is run in another thread.  This obviously isn't possible in NodeJS (due the the single thread) :)</p>
  
  <p>I can stub out the tasks, but how do I make the stubs "wait" for a period of time without blocking the thread so that I can hit the REST endpoint and get status updates?</p>