How can I exclude files from Jest watch?

前端 未结 7 1611
眼角桃花
眼角桃花 2021-02-01 12:17

I\'m doing some slightly bizarre stuff using Jest for testing where I\'m writing some stuff to disk. If I use the watch flag in Jest however then I\'m finding (quit

相关标签:
7条回答
  • 2021-02-01 13:13

    Skipping files in the test cases report collection is possible using "collectCoverageFrom" in the latest version of create-react-app, jest:

    "jest": {
        "collectCoverageFrom": [
            "src/**/*.{js,jsx,ts,tsx}",
            "!<rootDir>/src/registerServiceWorker.js",
            "!<rootDir>/src/serviceWorker.js",
            "!<rootDir>/node_modules/"
        ]
    },
    
    0 讨论(0)
提交回复
热议问题