(There is a related question here: Jasmine test does not see AngularJS module)
I just want to test a service without bootstrapping Angular.
I have look at so
If you wanna test a controller you can inject and test it as below.
describe('When access Controller', function () {
beforeEach(module('app'));
var $controller;
beforeEach(inject(function (_$controller_) {
// The injector unwraps the underscores (_) from around the parameter names when matching
$controller = _$controller_;
}));
describe('$scope.objectState', function () {
it('is saying hello', function () {
var $scope = {};
var controller = $controller('yourController', { $scope: $scope });
expect($scope.objectState).toEqual('hello');
});
});
});