Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

457
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda