2

我试图在运行笑话测试后获取测试结果和代码覆盖率数据。结果文件包含测试结果,但没有覆盖数据。我正在使用 jest-junit 作为我的记者。这是我的 package.json 中的内容:

  "scripts": {
    "test": "jest --verbose --silent --coverage --coverageDirectory=./",
    "start": "node server.js",
    "dev": "nodemon server.js"
  },
  "jest": {
    "testEnvironment": "node",
    "coveragePathIgnorePatterns": [
      "/node_modules/"
    ],
    "coverageReporters": [
      "text",
      "jest-junit"
    ],
    "reporters": [
      "default",
      "jest-junit"
    ]
  },
  "jest-junit": {
    "suiteName": "jest tests",
    "outputDirectory": ".",
    "outputName": "junit.xml",
    "uniqueOutputName": "false",
    "classNameTemplate": "{classname}-{title}",
    "titleTemplate": "{classname}-{title}",
    "ancestorSeparator": " › ",
    "usePathForSuiteName": "true"
  }
4

0 回答 0