Closed wbhminnt closed 6 years ago
There are quite few approaches. First I will suggest that you upgrade to latest version. That version has 2 classes https://stomp-js.github.io/ng2-stompjs/injectables/StompRService.html and https://stomp-js.github.io/ng2-stompjs/injectables/StompService.html (both have same structures other than the constructor)
StompRService does not need config as part of the constructor and does not try to connect until explicitly asked to do so. Depending on what you want to achieve this itself may be sufficient.
If not, I would suggest one of the following:
Let me know if you need further assistance.
On the other hand CI's like Travis support RabbitMQ out of the box.
This project goes one step further and uses docker to pull an image of RabbitMQ that has WebStomp enambled. See https://github.com/stomp-js/ng2-stompjs/blob/master/.travis.yml for details.
Great!
This will definetively help.
Thanks for the information.
Hello,
I'm trying to involve CI providers to run the tests for my Angular 4 application. The problem is, that while testing I don't have any STOMP broker running. So the application tries to reconnect to the websocket server periodically.
Is there any option to somehow mock the stomService so that the tests pass?
This is the code I have so far:
app.component.spec.ts
ws-client.component.spec.ts
Thanks a lot!