2
有没有办法让这个通用的点,我可以有一个副本,并通过配置项目和文件列表进入它而不是复制它为每个文件/配置组合?如何创建参数化和可重用的吞咽任务
我很想有潜在古怪像
gulp.task('foo_test', function (cb) {
run_tests(files.foo_list, config.fooCoverage);
cb();
}
注意,在我使用lazypipe和gulp-load-plugins完整的文件here
// test the server functions and collect coverage data
gulp.task('api_test', function (cb) {
gulp.src(files.api_files)
.pipe(istanbulPre())
.on('end', function() {
gulp.src(files.api_test_files)
.pipe(mochaTask())
.pipe(istanbulAPI())
.on('end', cb);
});
});
var istanbulAPI = lazypipe()
.pipe(plugins.istanbul.writeReports, config.apiCoverage);
config = {
apiCoverage: {
reporters: ['json'],
reportOpts: {
json: {
dir: 'coverage',
file: 'coverage-api.json'
}
}
},
谢谢。我用了很长时间的咕噜声,以至于我认为我忘记了这个咕嘟咕噜的声音真的是老式的js。在我的大文件中重复的数量正在扰乱我。感谢您花时间根据实际的src扩展答案。 – skarface