我的.NET
申请适用于Angular
&我们使用Jasmine
框架来测试用户界面。
Karma
以启动UI测试。
在开发阶段,我通过运行command prompt
karma start
启动它
现在,
debug
按钮之前浏览器也会关闭,因此我们无法进行调试。如何制作Karma wait
?任何帮助将不胜感激。刚开始使用angularJS,对不起,如果以上问题太天真,但已经花了一段时间了解这一点。
答案 0 :(得分:1)
您启用了业力单次运行。
在 karma.config.js 中将 singleRun 更改为 false
// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: false,
完整档案
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
// angular-filesort sorts angular dependencies upon injection to prevent
// angular constants loading before angular itself
frameworks: ['bower', 'jasmine', 'angular-filesort'],
// list of files / patterns to load in the browser
files: gulpConfig.karma.files,
// list of files to exclude
exclude: gulpConfig.karma.exclude,
// 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', '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
});
}
注意:强>
要退出连续运行,请使用旧的 Ctrl + c
还要找某种记者,这样你就可以看到提示中发生了什么。
Here是可用记者名单。