I would like to verify that bar() is called inside foo() from my unit test.
bar()
foo()
I figured that Sinon spies might be suitable, but I don\'t know
Shouldn't you be spying on bar, rather than foo?
var spy = sinon.spy(bar)
Call foo:
Check bar was called:
console.log(spy.calledOnce)