Mock NATS Client
A mocked NATS client for unit test. All messaging actions are carried out in memory only.
Has the same function signature and typing with the original ts-nats library.
Author
Usage
Installation
yarn add @onichandame/mock-nats-client
Connection
import { connect } from '@onichandame/mock-nats-client'
const nc = await connect()
Subscribe:
nc.subscribe('subject', (e, msg) => console.log(msg.data))
Publish:
nc.publish('subscribe', {})
Any feature request or bug report is welcome.