Unit test to make sure that an error eventHandler is added to the subscribers.

Signed-off-by: OwenPatey <owen_patey@hotmail.com>
Add test to make sure that a subscriber is removed when it emits an error event.

Signed-off-by: OwenPatey <owen_patey@hotmail.com>
Add production error event handler to incoming socket connections

Signed-off-by: OwenPatey <owen_patey@hotmail.com>
Reorder tests - the state of the subscribers array has an execution order dependency

Signed-off-by: OwenPatey <owen_patey@hotmail.com>
Move subscribers array into createPublisher function body so it is not a global variable.

Signed-off-by: OwenPatey <owen_patey@hotmail.com>
Implement fix to error handling unit test.

Signed-off-by: OwenPatey <owen_patey@hotmail.com>