因此,当我为 AngularJS 应用程序运行 Spec Runner 时出现此错误。
在我的代码中,定义了应用程序设置,并且一切似乎都在正确的位置。Live App 上的这些依赖项没有问题。
这是 app.core 模块
(function () {
'use strict';
angular
.module('app.core', [
//'ngAnimate',
'common.exception',
'common.logger',
'ui.router',
'ngStorage',
'xeditable',
'ngSanitize'
]);
})();
这是前面提到的 APP_SETTINGS 文件
(function() {
'use strict';
angular.module('settings', []);
angular
.module('settings')
.constant('APP_SETTINGS', new (function() { // jshint ignore:line
this.GODZILLA_URL = 'http://node17.catapult.dev.boozallenet.com:8082/api/applications/godzilla/colap/count/';
this.GODZILLA_EVENTS_URL = 'http://node17.catapult.dev.boozallenet.com:8082/api/applications/godzilla/colap/events/';
this.DOCUMENT_LINK = 'http://node17.catapult.dev.boozallenet.com/Search/viewDetails/index/?itemId=';
this.GEOSTPATIAL_URL = 'http://node17.catapult.dev.boozallenet.com:8083/api/v2/geospatial/';
this.DS_SOURCE_NAME = "Auto-Tagged";
this.DEFAULT_DELAY_INCREMENT_MILLI = 300;
this.DEFAULT_DELAY_EXECUTE_MILLI = 700;
this.DEFAULT_WIDGET_SIZES = {
"chart": {
sizeX: 3,
sizeY: 12,
minSizeX: 3,
minSizeY: 10
},
"table": {
sizeX: 11,
sizeY: 22,
minSizeX: 3,
minSizeY: 15
},
"map": {
sizeX: 6,
sizeY: 12,
minSizeX: 2,
minSizeY: 2
}
};
this.DATASOURCE_PROPERTIES = {
"Auto-Tagged": {color: "#F15C80"}, //red
"GLIDR": {color: "#7CB5EC"}, //blue
"J9": {color: "#90ED7D"}, //green
"CIDNE": {color: "#F7A35C"} //yellow
};
})());
})();
这是应用程序模块
(function () {
'use strict';
angular.module('app', [
// App Modules
'settings',
'app.core',
'app.navigation',
'app.widgets',
'app.workspace',
'app.dslegend',
'app.custompage',
// Common Modules
'common.utilities',
'common.exception',
'ngLodash',
'ngSanitize'
]);
})();
这是规范测试文件,它在一开始就停止了。
describe('DataService', function() {
beforeEach(function() {
bard.appModule('app.core');
bard.inject('$httpBackend', '$q', '$rootScope', 'DataService', 'APP_SETTINGS');
});
//bard.verifyNoOutstandingHttpRequests();
afterEach(function() {
$httpBackend.verifyNoOutstandingExpectation();
$httpBackend.verifyNoOutstandingRequest();
});