Jon*_*now 1 javascript jasmine angularjs karma-runner
我karma.conf.js喜欢这样的:
module.exports = function(config){
config.set({
files : [
'static_dev/js/lib/underscore-min.js',
'static_dev/js/lib/angular.1.2.9.min.js',
'static_dev/js/lib/angular-cookies.1.1.5.min.js',
'static_dev/js/lib/ui-bootstrap-custom-tpls-0.10.0.js',
'static_dev/js/lib/angular-tags-0.2.10-tpls.min.js',
'static_dev/js/lib/angular-mocks.js',
'static_dev/js/angular/modules/*.js',
'static_dev/js/angular/controllers/**/*.js',
'static_dev/js/angular/directives/**/*.js',
'static_dev/js/angular/services/**/*.js',
'static_dev/js/angular/**/test/*.js'
],
reporters: ['progress', 'coverage'],
autoWatch: true,
colors: true,
frameworks: ['jasmine'],
browsers : ['PhantomJS'],
})}
Run Code Online (Sandbox Code Playgroud)
这一切都很好,但我想"自动观察"只匹配的文件,'static_dev/js/angular/**/test/*.js'这可能吗?
您应该为文件使用完整的模式语法,这样您就可以禁用对不想要的文件的监视:
files : [
//this pattern will NOT be watched
{pattern: 'path/to/**/*.js', watched: false, included: true, served: true},
//this one will be watched
{pattern: 'path/to/other/**/*.js', watched: true, included: true, served: true}
],
autowatch: true
Run Code Online (Sandbox Code Playgroud)
请注意watched,included和served默认值true.
"如果
autoWatch是true已设置的所有文件watched到true会观看了变化."
来自:业力配置 - 文件
| 归档时间: |
|
| 查看次数: |
538 次 |
| 最近记录: |