cvan/galaxy-api — pull request #182 by at-kevinlau (2014-04-08 11:01:20+00:00)
Title: Pre-testing library (WIP) (#167)

I've added a basic pre-testing library with two functions:
- ``startTestServer`` starts running the API server at port 5055 using an instance of fakeredis.
- ``postJSON`` posts a JSON blob to the API server. It's technically not in the scope of the issue, but I wasn't able to find any similar functions that already did this, and it'll be necessary later for other tests anyway.

My main issue right now is that, since ``startTestServer`` starts the server as a new process using ``child_process`` rather than through Javascript directly, I can't use callbacks to determine when the server's actually done loading. For now, I'm just doing ``setTimeout(done, 1000)`` so that the server will be done loading before the test runs. Any suggestions?