My karma/jasmine testing freezes when I pass a boolen or a null to the $controller parameter injection. If I comment that line or code at least I get the expected error, but if I include it the test doesn't do anything until it disconnects itself. Any idea/solution please? Here's the part of the code (the activeTab value is the problematic one):
beforeEach(inject(
function (_$rootScope_, _$location_, _App_, _$q_, _LocationParams_, _filtersFn_, _progressBar_, _$httpBackend_, $controller) {
$rootScope = _$rootScope_;
$scope = $parentScope = $rootScope.$new();
$scope.$parent = $parentScope;
$scope.$parent.$parent = $parentScope;
$location = _$location_;
appFactory = _App_;
$q = _$q_;
LocationParams = _LocationParams_;
filtersFn = _filtersFn_;
progressBar = _progressBar_;
$httpBackend = _$httpBackend_;
ctrl = $controller('AppIndexCtrl', {
$scope: $scope,
$location: $location,
App: appFactory,
data: _data,
LocationParams: LocationParams,
activeTab: null,
filtersFn: filtersFn,
progressBar: progressBar
});
}));
Aucun commentaire:
Enregistrer un commentaire