我是Karma的新手,我刚刚按照他们的安装和配置教程。 我使用:
启动了Karmakarma start my.conf.js
但是我收到了一个错误:
INFO [karma]: Karma v0.12.23 server started at http://localhost:9876/
INFO [launcher]: Starting browser Chrome
INFO [Chrome 37.0.2062 (Windows 7)]: Connected on socket ZQsMdsAHICuCrj3MXcDz with id 90144583
Chrome 37.0.2062 (Windows 7) ERROR
Uncaught Error: jasmine.Suite() required
at local/Projects/webserver/node_modules/karma-jasmine/lib/jasmine.js:2294
我正在运行node-express和anguler + requirejs。 知道为什么会发生这种错误吗?如何解决?
由于
编辑: 我的my.conf.js文件:
// Karma配置 //生成于2014年9月18日星期四18:11:55 GMT + 0300(耶路撒冷日光时间)
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', 'requirejs'],
// list of files / patterns to load in the browser
files: [
'public/test/test-main.js',
{pattern: 'public/js/**/*.js', included: false},
{pattern: 'public/lib/**/*.js', included: false},
{pattern: 'public/test/**/*Spec.js', included: false}
],
// list of files to exclude
exclude: [
'public/js/main.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: false
}); };
答案 0 :(得分:2)
将“it”块包裹在描述块内,然后重试。
答案 1 :(得分:0)
我通过重新安装业力,茉莉和业力茉莉和业力需求来解决这个问题。出于某种原因,它起初并没有起作用。