How to test Jasmine with websocket?

262 views
Skip to first unread message

Kumar Ramalingam

unread,
May 28, 2019, 5:43:01 PM5/28/19
to Jasmine
Test the test cases websocket onmessage data in jasmine?

Gregg Van Hove

unread,
May 31, 2019, 9:05:07 PM5/31/19
to jasmi...@googlegroups.com
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!

- Gregg

On Tue, May 28, 2019 at 2:43 PM Kumar Ramalingam <kum...@contus.in> wrote:
Test the test cases websocket onmessage data in jasmine?

--
You received this message because you are subscribed to the Google Groups "Jasmine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jasmine-js+...@googlegroups.com.
To post to this group, send email to jasmi...@googlegroups.com.
Visit this group at https://groups.google.com/group/jasmine-js.
To view this discussion on the web visit https://groups.google.com/d/msgid/jasmine-js/696740cb-0790-432e-8d04-9b70c3c00d15%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages