I\'m using Angular 1.5.5 and Jasmine as test framework. Currently I have to do something like this so that the test passes:
function createController(bindings) {
There is an issue in github regarding this: https://github.com/angular/angular.js/issues/14129
Basically it is working as intended, not calling $onInit
or $onChanges
automatically.
it makes no sense (or low sense) to execute $onInit, I explain it: $componentController is to instance controllers a kind of replacement for $controller, but instead of creating instances of controllers registered by the controllerProvider it creates instances of controllers registered through directives (the ones that satisfies a component definition). So, once you have the instance of the controller, you can call manually $onInit, and all the lifecycle of your controller, the idea is that you are testing a controller, not a directive (and its relationships).