Testing Web Sockets with Jasmine
Here is some code that has been written for web-socket using stomp protocol. function WS(url) { var ws = new SockJS('/notifications'); this.client = Stomp.over(ws), this.client.connect('', '', function() { console.log('Connected'); }, function(error) { console.log('STOMP protocol error: ', error.headers.message); }); } WS.prototype.disconnect = function() { }; WS.prototype.subscribe = function() { }; WS.prototype.unSubscribe = function() { }; WS.prototype.send = function(msg) { }; I found this post but it requires actual connection to server, Unit testing Node.js and WebSockets (Socket.io) How