Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

460
Views
Unit testing client side of WAMP webpsockets using wampy js

I'm trying to write unit tests for websocket logic but I'm struggling with mocking the server side.

In my project I use wampy.js ( https://github.com/KSDaemon/wampy.js/ ) for creating client side connection. I tried using https://github.com/romgain/jest-websocket-mock for mocking the server side of connection but I cannot figure out how to write the test case properly so that the client connects to the server.

I was trying to recreate this simple scenario but with wamp.js https://github.com/romgain/jest-websocket-mock#run-assertions-on-messages-as-they-are-received-by-the-mock-server

I'm aware I need to add a mock as described here https://github.com/romgain/jest-websocket-mock#using-jest-websocket-mock-to-interact-with-a-non-global-websocket-object

Does anyone succeeded with creating working test scenario? Is there a different solution that would work apart from jest-websocket-mock?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!