0
我试图建立噶一个新的项目,我收到以下错误'警告:试图不止一次加载角。'噶警告
'WARNING: Tried to load angular more than once.'
我karma.conf.js看起来像这样
module.exports = function(config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',
// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['jasmine'],
// list of files/patterns to load in the browser
files: [
'app/bower_components/angular/angular.js',
'app/bower_components/angular-mocks/angular-mocks.js',
'dist/js/combined.bower.js',
'app/js/routes.js',
'app/test/ENV.js',
'app/js/**/*.js',
'app/test/**/*.js'
],
// list of files to exclude
exclude: [
'app/js/filter.list.js'
],
// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
'app/js/**/*.js': ['env']
},
envPreprocessor: [
'ENV'
],
// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['progress'],
// web server port
port: 9876,
// enable/disable colors in the output (reporters and logs)
colors: true,
// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,
// enable/disable watching file and executing tests whenever any file changes
autoWatch: true,
// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ['PhantomJS'],
// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: false,
// Concurrency level
// how many browser should be started simultaneous
concurrency: Infinity
})
}
为了,我加载了Angular,angular-mock,我的dist文件夹中的联合bower资源,我的路线,我的角度模块定义(不是我的想法),我需要的环境变量,我想测试的javascript控制器,我的测试文件夹。如果我不包含我的组合的bower文件,那么会出现一个关于无法加载jquery的错误,以及另一个针对其他每个依赖项的错误。
我能做些什么来解决这个问题?