节点包因果报应没有在没有信息的情况下运行
Node Package karma not running with no info
我创建了karma.conf.js文件来运行测试,但它不起作用,终端也没有返回有用的信息。我的文档中没有任何可能引发错误的地方,也没有行号。。。我已经看了两天的文件,找不到可能是什么原因。
这是最终答案:
$ karma start karma.conf.js
12 04 2016 16:08:09.101:ERROR [config]: Invalid config file!
SyntaxError: Unexpected string
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:414:25)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:313:12)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at Object.parseConfig (/Users/Bizarre/Desktop/Coding/Web/UHK/Course3/conFusion/node_modules/karma/lib/config.js:284:22)
at new Server (/Users/Bizarre/Desktop/Coding/Web/UHK/Course3/conFusion/node_modules/karma/lib/server.js:57:20)
at Object.exports.run (/Users/Bizarre/Desktop/Coding/Web/UHK/Course3/conFusion/node_modules/karma/lib/cli.js:243:7)
at requireCliAndRun (/usr/local/lib/node_modules/karma-cli/bin/karma:44:16)
at /usr/local/lib/node_modules/karma-cli/bin/karma:54:12
at /usr/local/lib/node_modules/karma-cli/node_modules/resolve/lib/async.js:44:21
at ondir (/usr/local/lib/node_modules/karma-cli/node_modules/resolve/lib/async.js:187:31)
at /usr/local/lib/node_modules/karma-cli/node_modules/resolve/lib/async.js:153:39
at onex (/usr/local/lib/node_modules/karma-cli/node_modules/resolve/lib/async.js:93:22)
这是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: [
'bower_components/angular/angular.js',
'bower_components/angular-resource/angular-resource.js',
'bower_components/angular-ui-router/release/angular-ui-router.js',
'bower_components/angular-mocks/angular-mocks.js',
'app/scripts/*.js'
'test/unit/**/*.js'
],
// list of files to exclude
exclude: [
'test/protractor.conf.js', 'test/e2e/*.js'
],
// 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 any file changes
autoWatch: true,
// start these browsers
//available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ['Chrome','PhantomJS','PhantomJS_custom'],
// you can define custom flags
customLaunchers: {
'PhantomJS_custom': {
base: 'PhantomJS',
options: {
windowName: 'my-window',
settings: {
webSecurityEnabled: false
},
},
flags: ['--load-images=true'],
debug: true
}
},
phantomjsLauncher: {
// Have phantomjs exit if a ResourceError is encountered (useful if karma exits without killing phantom)
exitOnResourceError: true
},
// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: false,
// Concurrency level
// how many browser should be started simultaneously
concurrency: Infinity
})
};
文件中缺少一个逗号:
// list of files / patterns to load in the browser
files: [
'bower_components/angular/angular.js',
'bower_components/angular-resource/angular-resource.js',
'bower_components/angular-ui-router/release/angular-ui-router.js',
'bower_components/angular-mocks/angular-mocks.js',
'app/scripts/*.js',
'test/unit/**/*.js'
]
,
相关文章:
- 在禁用浏览器flash插件的情况下运行Karma测试
- 在不加载页面的情况下运行javascript
- CSS转换获胜't在没有“setTimeout”的情况下运行
- CSS 转换不会在没有 setTimeout 的情况下运行
- 我的javascript不会在没有警报的情况下运行
- Apache Cordova:在不启动浏览器应用程序的情况下运行Cordova运行浏览器
- 强pm不会在NODE_ENV=生产的情况下运行
- Javascript在不打算运行的情况下运行多次
- 在不安装Zend优化器的情况下运行php文件
- 如何在没有缓存/cookie的情况下运行/调试Web应用程序项目
- 仅在尚未运行jQuery UI的情况下运行动画
- 如何在启用ES6功能的情况下运行Node.js应用程序
- 如何在没有网络工作者的情况下运行多个脚本
- 节点包因果报应没有在没有信息的情况下运行
- 如何在不阻塞脚本的情况下运行脚本
- 是否可以在不重新加载的情况下运行注入的脚本
- 使用 setTimeout 在不阻止输入的情况下运行大型任务,并使用 Promise 找出任务何时完成
- 使此代码在不使用匿名函数的情况下运行
- 无法在不刷新的情况下运行多个 AJAX 调用
- 谷歌地理编码仅在没有API密钥的情况下运行