Friday, 3 August 2018

Mocking/stubbing events in Sinon?

Hii!!I've got a piece of code I'd want to test, it fires upon receiving a "message" event from an external source (an external server, indeed).The code is something like thisinstance.on("message", function(){ //code }); so the question is... how to mock or stub the "message" event so the method executes and calls the callback? Thanks!!!

Submitted August 03, 2018 at 01:13PM by NodeNoodle

No comments:

Post a Comment