Testing stateProvider state if configured in config in angularJS returns null on $state
问题 I have a config like this one: angular.module('myModule', ['ui.router']) .config(['$stateProvider', function($stateProvider) { $stateProvider .state('app.home', { abstract: true, url: '/home', template: '<div>Foo Bar</div>' }); }]); and a unit test using jasmine like this: 'use strict'; describe('Module: myModule', function() { var $rootScope, $state; beforeEach(module('ui.router')); beforeEach(module('myModule')); beforeEach(inject(function(_$rootScope_, _$state_) { $state = _$state_;