stomp-js / ng2-stompjs

Angular 6 and 7 - Stomp service over Websockets
https://stomp-js.github.io/
Apache License 2.0
182 stars 32 forks source link

Mock RxStompService connect method #245

Closed kravinash13 closed 3 years ago

kravinash13 commented 3 years ago

How do we mock RxStompService connect method for unit test in Jest.

kum-deepak commented 3 years ago

I am not sure if the current version of RxStompService has a connect method. Otherwise mocking should be just like any other object. Please check https://stomp-js.github.io/api-docs/latest/classes/RxStomp.html (RxStompService is an injectable version of RxStomp).

kravinash13 commented 3 years ago

@kum-deepak Thank you. Was able to write unit test by mocking RxStompService.