我使用grunt来运行我的mocha测试,并且在控制台中看到测试结果是OK,问题在于此任务正在生成报告,但是当您运行此HTML报告时,您只会看到在文本中运行的日志...我想要看到测试聚合,和摩卡单元测试运行好,我在这里失踪?Grunt为mocha测试提供html报告
mochaTest: {
test: {
options: {
reporter: 'spec',
colors: true,
summery: true,
captureFile: 'results.html', // Optionally capture the reporter output to a file
quiet: false, // Optionally suppress output to standard out (defaults to false)
clearRequireCache: true // Optionally clear the require cache before running tests (defaults to false)
},
src: ['test/*spec.js'],
excludes: ['plugins']
},
'travis-cov': {
options: {
reporter: 'travis-cov'
}
}
},
我使用包 grunt.loadNpmTasks( '咕噜-摩卡试验');
https://github.com/pghalliday/grunt-mocha-test
我想这样或者我可以使用任何其他不错的HTML报告报表...
你可以使用[mochawesome](https://github.com/adamgruber/mochawesome)。改变你的记者mochawesome! –
@IsmailRBOUH - 看起来不错,但您能否提供如何在GRUNT中使用它的示例? –
只要'npm install --save-dev mochawesome'然后改变'记者:'spec','给'记者:'mochawesome',','grunt-mocha-test'将会完成剩下的工作! –