gpt4 book ai didi

javascript - Karma 监视特定文件

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

我有一个像这样的 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'],

})}

一切正常,但我只想“自动监视”匹配 '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

请注意,watchedincludedserved 默认值为 true .

"If autoWatch is true all files that have set watched to true will be watched for changes."

发件人:Karma configuration - Files

关于javascript - Karma 监视特定文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22174949/

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