AngularJS, prevent init method on controller from launching during jasmine tests
问题 I have a controller with a init() method launched on instantiation. It does a bunch of things which are useful for my app in a live environment, but that messes up with my unit-tests spies. Is there a way to prevent its call when instantiating the controller in the unit-test environment ? Or maybe a way to have it called automatically in the webapp context without making an explicit call to init() at the end of the controller code ? 回答1: It is a bit hard to provide precise guidance without