I have a function like this
helloWorldAsync(cb)
This function will return the callback if there's an error.
var spy = sinon.spy()
helloWorldAsync(spy)
expect(spy).to.have.been.called
However this code is running asynchronously so I believe the runtime (is that you call it?) is passing right over the helloWorldAsync() function and expecting spy to have been called early.
How do I monitor this function's callback?
Aucun commentaire:
Enregistrer un commentaire