Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Options for Mock Stompjs Server #382

Open
IgnacioHR opened this issue Sep 6, 2021 · 2 comments
Open

Options for Mock Stompjs Server #382

IgnacioHR opened this issue Sep 6, 2021 · 2 comments

Comments

@IgnacioHR
Copy link

Hello,

I'm missing a Mock Stomp Server that can be used to automate tests with jest. And documentation about how to write basic tests.

I've already tested https://github.com/rufusraghunath/js-stomp-utils/tree/master/packages/mock-stomp-broker with no success. The issue will be reported in that repository.

Thank you in advance!

@kum-deepak
Copy link
Member

I know it makes a lot of sense to have a mock stomp broker.

For testing this library I needed one, at that time I could not find any reasonable one, so, ended up using a complete RabbitMQ server. To simulate errors (like missing heartbeats), I use a wrapper over the WebSocket which can alter (or eat away) responses. See the specs folder and the Doockerfile to check the current setup.

If one wants to use this code as a base, they can use quite a lot of classes, like Frame, Parser, etc. to implement a Mock broker. That would additionally allow mocks to run within even the browser (without using a TCP port). This will make tests run much faster.

If you would like to attempt and need details, please let me know.

@sergiykh
Copy link

@IgnacioHR We are using https://github.com/rufusraghunath/js-stomp-utils/tree/master/packages/mock-stomp-broker in our e2e tests. It works fine to mock stomp responses.

@kum-deepak kum-deepak changed the title Feature request Mock Stompjs Server Options for Mock Stompjs Server Dec 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants