Skip to content

Mocking the connect function of nats #1665

Answered by Jarema
chethan-b-hpe asked this question in Q&A
Discussion options

You must be logged in to vote

There is no mock available.
Considering how rich is NATS API, it would be really hard, if not impossible, to mock everything in a reliable way, or a way that helps more than harms.

We recommend running an actual nats-server for tests. It is really lightweight and especially easy in Go, where you can run it embedded into your tests.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by piotrpio
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants