• Empleos
  • Sobre nosotros
  • profesionales
    • Inicio
    • Empleos
    • Cursos y retos
  • empresas
    • Inicio
    • Publicar vacante
    • Nuestro proceso
    • Precios
    • Evaluaciones
    • Nómina
    • Blog
    • Comercial
    • Calculadora de salario

0

202
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 3 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 Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recomiéndame algunas ofertas
Necesito ayuda