关于 jest 测试结果如何在浏览器上显示的问题

最近在作jest的测试,发现关于jest的文章翻来覆去就那几篇,在这里补充一篇

  • 我在执行 yarn test 的时候,以为在小黑框里看测试结果有点难受,就想去网上找一些关于jest reporter的文章,结果没有。
  • 在我不懈的努力下,找到了jest-html-reporter
这里放上连接: https://github.com/Hargne/jes...

1. 先安装 :html

yarn add  jest-html-reporter --dev

or

npm install jest-html-reporter --save-dev

2. 固然了,在package.json中也要作相关配置。node

"jest": {
     "testResultsProcessor": "./node_modules/jest-html-reporter"
 }

3. 而后再执行yarn test就会在最外层生成test-report.html,打开它就行了。git

相关文章
相关标签/搜索