You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in api doc, it is said a spy could be created by this way:
var spy = sinon.spy(myFunc);
Spies on the provided function
my code:
function a(){}
function b(){}
function fn(args){
args ? a(args) : b(args)
}
var spy = sinon.spy(a)
it('excute function a if args is true', function(){
fn(1)
expect(spy.calledOnce).to.be.ok() // failed
fn(true)
expect(spy.calledTwice).to.be.ok() // failed too
})
why?
The text was updated successfully, but these errors were encountered:
in api doc, it is said a spy could be created by this way:
my code:
why?
The text was updated successfully, but these errors were encountered: