add integration test for dispatch logic
Value
- the unit tests for the
dispatch
module currently rely on a live socket. (ie: the require invokingrun
and then listening on a socket, when they could simply plass messages into the pure functiondispatch.dispatch
) - let's:
- refactor the
dispatch
unit tests so they mock everything at the module level and don't invokerun
- add a "big bracket" (integration) test for the
dispatch
module that:- doesn't mock out the command execution or database layer
- invokes
run
, and attempts to test the full execution path for handling a message from coming off the socket from signald to putting messages back on the socket for signald (which we will accomplish by using the newapp
module to inject asock
resource that receives messages from a testingEventEmitter
and writes messages to a stub socket that we can spy on)
- refactor the
Edited by aguestuser