我使用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'將會完成剩下的工作! –