Jasmine test: how to call through function that is called in tested function?
问题 I try to test a JavaScript function with Jasmine. It looks like this: show: function(){ this.work(); var mod = new Module(); mod.doSomething(); } I am now testing if work() is called in show() , which is no problem. But then an error occurs in mod.doSomething() . This makes my test fail although it actually passed. What can I do to prevent mod.doSomething to be called or at least executed. Is there something like callThrough() for nonused function calls? The only idea I had was to write a