在 Adonis 中生成 html 覆盖率报告

Generate html coverage report in Adonis

下午好,你们好吗? 已经谢谢你了 我是新手但不是 adonis 并且按照这个主题为这个项目生成一个测试报告覆盖率文件 project ->https://github.com/Yuri-Tiofilo/adonisTdd 1,将文件 .nycrc 添加到项目的根文件夹和 运行 adonis test 命令,它不会生成此报告。 有配置吗?

要生成报告,请转到您的 package.json 文件

"scripts": {
    "start": "node server.js",
    "test": "node ace test"
  },

替换为

"scripts": {
    "start": "node server.js",
    "test": "nyc node ace test"
  },

太棒了,非常感谢@Onwubiko Chibuike,制作、替换和添加 nyc 模块,它成功了,我将把步骤留在这里,以备将来感兴趣
1. 安装模块 nyc

yarn add nycnpm i nyc

2º - 替换 package.json

"scripts": { "start": "node server.js", "test": "nyc node ace test" }, 


3º - 在基础文件项目中创建文件 .nycrc

{
  "all": true,
  "include": ["app/**"],
  "reporter": "html",
  "report-dir": "test/coverage"
}


4º - 运行 命令

npm test


适合我,谢谢。