I'd like to be able to verify what's being injected into my controller, and further, to use that information in additional tests.
I'd expect to be able to do something like this:
var app = angular.module('MyApp',[]);
app.controller('MyController', ['$scope', '$q', function($scope, $q) {
$scope.myFn = function () {};
}]);
describe('MyController', function () {
it('should require $scope and $q', function () {
expect(app.controller("MyController").requires).toBe(['$scope', '$q']);
});
});
But when I execute this test I get:
Expected [ ] to be [ '$scope', '$q' ]
Any help would be appreciated,
-michael