Closed stoicAlchemist closed 4 years ago
Unless you are testing specific client protocol, you shouldn't mock the server. Simply start one the way we do for our tests.
For the record, https://github.com/FrostDigital/mock-nats-client may be of interest.
I've been researching for the best way to mock NATS and haven't found anything yet. I'm using ts-nats for interacting with the development server but I'm adding Unit tests to the code before I go further with this and can't seem to find any tools to make that happen. As a reference, I'm using mongo-in-memory (it's not the ideal solution, but it works now) to do the same on Database requests; is there a way to have ts-nats "faking" responses?
Please tell me if this is not the place to ask/request for this features, I apologize in advance if it's not.