Encountering this specific error, where my injector seems to have trouble resolving a necessary dependency. Even with my limited understanding of Angular, it doesn't seem like this code should rely on any external modules.
The code functions properly in the browser but fails during testing. I've been following the examples provided in the documentation.
Running Angular version 1.2.13
(updated to 1.12.15
).
Snippet of the code:
var app = angular.module('app', [])
.controller('GreetingCtrl', function ($scope) {
$scope.title = "Hello World!";
$scope.message = "Test, test. One? Two?";
});
Below is the failing Jasmine test.
describe('app controllers', function () {
beforeEach(module('app'));
describe('GreetingCtrl', function () {
it('should says hello world', inject(function ($controller) {
var $scope = {};
$controller('GreetingCtrl', $scope);
expect($scope.title).toBe("Hello World!");
}));
});
});
I suspect the failure occurs before the test even runs. The file concatenation also seems correct. The jasmine test runner provides this error message:
Error: [$injector:unpr] http://errors.angularjs.org/1.2.13/$injector/unpr?p0=%24scopeProvider%20%3C-%20%24scope (line 4569) (1)
Edit: attempted upgrade to 1.12.15
, issue remains unchanged.