I would like to test web sockets that have been implemented using sockjs.
var sock = new SockJS('http://mydomain.com/my_prefix');
sock.onopen = function() {
console.log('open');
};
sock.onmessage = function(e) {
console.log('message', e.data);
};
sock.onclose = function() {
console.log('close');
};
I goggled and only found this article. This is not good enough because it's making actual connection rather than faking it.
I also tried SO but only found an unanswered question here.
Someone suggested sinonjs but I'm not able to find any decent example.
I'll appreciate if someone can shed some light on this topic.