gpt4 book ai didi

javascript - 需要 Karma : Uncaught Error: jasmine. Suite()

转载 作者:行者123 更新时间:2023-11-30 17:17:03 25 4
gpt4 key购买 nike

我是 Karma 的新手,我刚刚学习了他们的安装和配置教程。我开始使用 Karma:

karma 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 = 函数(配置){ 配置.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

});};

最佳答案

将您的“it” block 包裹在 describe block 中,然后重试。

关于javascript - 需要 Karma : Uncaught Error: jasmine. Suite(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25916975/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com