vendredi 29 juillet 2016

sails.js socket.io unit test

I'm developing an app using Sails + Angular and I want to create Unittest for my Angular controllers.

In my Angular controller I have this code:

io.socket.on('user',function(obj) {
   ...
}

How do I mock socket.io server to test the above code?

I'm using Jasmine/Karma to write and run my Angular test.

Thanks, TD

Aucun commentaire:

Enregistrer un commentaire