【发布时间】:2023-03-21 18:17:01
【问题描述】:
在单元测试下执行会给出“错误:[$injector:unpr] 未知提供者:$stateProvider
describe("Unit tests", function() {
var $rootScope, $injector, $state;
console.log("hello");
beforeEach(inject(function(_$rootScope_, _$state_, _$injector_, $templateCache) {
console.log("hello1");
$rootScope = _$rootScope_;
$injector = _$injector_;
$state = _$state_;
}));
describe("states", function() {
it("verify state configuration", function() {
var config = $state.get("DRaaS");
console.log(config, "cc");
});
});
});
【问题讨论】:
标签: arrays angularjs unit-testing mocha.js chai