Jest生成测试覆盖率_json

  1. npx jest --init 生成配置文件
  2. package.json添加执行命令
  "scripts": {
    "test": "jest --coverage"
  },

Jest生成测试覆盖率_其他_02

可以打开这个HTML文件再浏览器查看
Jest生成测试覆盖率_jest_03