【发布时间】:2017-01-15 03:42:14
【问题描述】:
大家好,我在午餐开始时遇到这个错误 karma karma.conf.js
20%20%20%20at%20Object.createInjector%20%5Bas%20injector%5D%20(http%3A%2F%2Flocalhost%3A9876%2Fbase%2FWebContent%2Fassets%2Fjs%2Fangular1.4.3%2Fangular.js %3Fbede50a38baeba3db7a4df46069 5d01ecb437273%3A4272%3A11)%0A%20%20%20%20at%20Object.workFn%20(http%3A%2F%2Flocalhost%3A9876%2Fbase%2FWebContent%2Fassets%2Fjs%2Fangular1.4.3%2Fangular-mocks.js %3F8bc8772418adb9b2fa9517 2525c3540d23e140f4%3A2393%3A52)%0A%20%20%20%20at%20attemptSync%20(http%3A%2F%2Flocalhost%3A9876%2FC%3A%2FUsers%2FZack%2Fnode_modules%2Fjasmine-core%2Flib%2Fjasmine-core %2Fjasmine.js%3F3 91e45351df9ee35392d2e5cb623221a969fc009%3A1886%3A24) 在 WebContent/assets/js/angular1.4.3/angular.js:68:12 在 forEach (WebContent/assets/js/angular1.4.3/angular.js:336:20) 在 loadModules (WebContent/assets/js/angular1.4.3/angular.js:4346:5) 在 Object.createInjector [作为注入器] (WebContent/assets/js/angular1.4.3/angular.js:4272:11) 在 Object.workFn (WebContent/assets/js/angular1.4.3/angular-mocks.js:2393:52) 在 WebContent/assets/js/angular1.4.3/angular.js:4385:15 Chrome 51.0.2704(Windows 10 0.0.0):执行 4 次,共 4 次(1 次失败)(0.117 秒 / 0.074 秒)
我的 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: [
'WebContent/assets/js/angular1.4.3/angular.js',
'WebContent/assets/js/angular1.4.3/angular-*.js',
'WebContent/assets/js/**/*.js',
'WebContent/apps/gapsweb/**/*.js',
'WebContent/apps/gapsweb/gaps.bootstrap.js',
'WebContent/apps/gapsweb/components/**/*.test.js'
],
// list of files to exclude
exclude: [
'WebContent/assets/js/translation/*.js'
],
// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
},
// 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: ['Chrome'],
// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: true,
// Concurrency level
// how many browser should be started simultaneous
concurrency: Infinity })};
那么问题出在哪里??我哪里错了?? 谢谢大家帮帮我!!
【问题讨论】:
-
请添加茉莉码
-
describe("A suite", function() { it("contains spec with an expect", function() { expect(true).toBe(true); }); });
-
只是脚本?
-
是的,只有这个脚本用于测试业力茉莉花
-
远程
'WebContent/assets/js/angular1.4.3/angular-*.js',
标签: angularjs unit-testing karma-jasmine