javascript - 从测试覆盖范围中排除单个文件

标签 javascript express jestjs

是否可以告诉 jest 从测试覆盖率报告中排除特定的文件?我不是在寻找.skip功能

最佳答案

  "jest": {
    "collectCoverageFrom": [
      "src/**/*.{js,jsx}",
      "!src/file.ext" // <-- use the negation operator to exclude files or paths
    ]
  }

关于javascript - 从测试覆盖范围中排除单个文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62841030/

相关文章:

javascript - 获取具有多个子对象的 JavaScript 对象的特定值

javascript - 如何在 JavaScript 中以编程方式传递参数?

jquery - 为每个 <li> 添加不需要的间距

javascript - Socket IO 发出事件两次

javascript - CSS 模块 @import 未能通过 Jest 测试套件

javascript - 我是否需要使用 TypeScript + React 将事件处理程序绑定(bind)到 `this`?

javascript - 切换 :active class with ReactJS

javascript - NodeJS 错误 - 发送后无法设置 header

typescript - MongoMemoryServer ;未处理的错误

jestjs - 在 monorepo 包中的 jest 配置中定位 monorepo 根目录