Based on your question here, I'm not sure what exactly you're trying to test with websockets. If you want to confirm that you've called the `onmessage` function appropriately, you should be able to use a spy (
https://jasmine.github.io/tutorials/your_first_suite#section-Spies) in some form, either by providing a fake object with the functions spied (`createSpyObj` maybe) or by using `spyOn` to replace the function on an existing object with a spy that you can inspect later.
Hope this helps. Thanks for using Jasmine!