我正在使用 yeoman 角度发生器。在这个生成器中,测试被放置在一个单独的文件夹'test'
中。我宁愿将它们保存在与我的 .js 文件相同的文件夹中。我给他们起名字.spec.js
。我需要在我的Gruntfile.js
文件中修复此问题,以便它们不包含在缩小、jshint 等中。
无论如何我可以排除以 .spec.js 结尾的文件吗?
// Make sure there are no obvious mistakes
jshint: {
options: {
jshintrc: '.jshintrc',
reporter: require('jshint-stylish')
},
all: {
src: [
'Gruntfile.js',
'<%= yeoman.app %>/scripts/{,*/}*.js'
]
},
test: {
options: {
jshintrc: 'test/.jshintrc'
},
src: ['test/spec/{,*/}*.js']
}
},