一、gulpfile.js中可以修改
gulp.task('website', function() {
return gulp.src(['src/api/serviceflow/website_workflow.js'], { read: false })
.pipe(mocha({
reporter: 'mochawesome',
reportDir: 'test',
reporterOptions: {
reportFilename: 'index',
quiet: true,
html: true,
},
ui: 'bdd',
}));
});
二、.mocharc.yml中修改
# bail: true,
timeout: 5000
# grep: he
require: 'src/config/global/hooks.js'
recursive: true
reporter: 'mochawesome'
reporter-option:
- 'reportFilename=index'
- 'reportDir=test'
- 'quiet=true'
- 'html=true'
retries: 3
配置Mocha自动化测试
本文介绍如何在gulpfile.js中配置Mocha任务进行自动化测试,包括设置测试文件路径、报告格式及选项等,并展示了如何通过.mocharc.yml进一步定制测试行为。
427

被折叠的 条评论
为什么被折叠?



