Technologies : NodeJs, Kafka, Mocha
The issue : I have a nodeJS service which given a String returns events with a many data.
How can I test this using Mocha ?
In a simple scenario the service returns one event with some data attached. In a more complex scenario the service publishes multiple events.
Is there a way I can test the services output at unit test level?
Possible solutions : A solution I can think of is to create a consumer inside the mocha test. Is there another practice/method I can follow ? Should I test this at a different level aka integration level ?