You must explicitly call the $ onInit function. $ componentController does not call this function as part of a lifecycle hook that fails.
There are ways that $ onInit is called an implication, which can be found here .
, $onInit , - $onInit. , $onInit , , AngularJS .
it('should expose device related properties to view', function () {
controller.$onInit();
expect(controller.devices).toBeDefined();
};