Jasmine Test in Angular for controller
问题 I get the following error: TypeError: undefined is not a function The problem is that the common is module and a factory and the problem is on my line var ctrl = $controllerConstructor("resetPasswordSentScreen", { $scope: scope, common: common}); Here is the full test: describe('resetPasswordSentScreen', function () { var scope, $controllerConstructor; beforeEach(module('common', 'app')); beforeEach(inject(function($controller, $rootScope) { scope = $rootScope.$new(); $controllerConstructor =