I have a method written in javascript and I use Jasmine to test the method. This method is a void type that calls another method.
I need to check if a method calls another method, the real method returns void.
what should I write in the expect clause to compare it.
sendMessage=function(data){ if(data!=null) { postMessage(data); } }
Jasmine Code:
describe('unit test void method', function(){ it("sendMessage method should invoke the postMessage", function () { expect(sendMessage("hello"); }) })
What should I compare with him?
source share