tommydudebreaux/hammock — pull request #3 by SQUARE-WAVES (2013-11-12 19:33:35+00:00)
Title: execute client side events async

Since the same hammock response is used on both the "server" and the client side, exception handling in the server can cause the finish event on the response to be called multiple times. This can cause unit tests to fail with very unexpected results. This request wraps the client side events in the res.end method in a set immediate, to kinda simulate the response traveling over a network (I realize it's not a great simulation.) This prevents errors on the client side from invoking behavior on the server side.

As well I updated some of the tests to function better, and added tests for the specific case this covers.