How to test inner methods of the high-order functions

32 views
Skip to first unread message

Chang Lung

unread,
Aug 16, 2017, 6:07:51 AM8/16/17
to Sinon.JS
I have a high order function like this,

foo()=>{
 bar
.boo()
}

How can I write the testing for boo method is called or not? thank you!

Carl Erik Kopseng

unread,
Aug 18, 2017, 2:21:54 AM8/18/17
to Sinon.JS
Spy on bar.boo and call foo. Then assert bar.boo.calledOnce
Reply all
Reply to author
Forward
0 new messages