Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jestjs 开玩笑——watch始终运行所有测试_Jestjs_Babel Jest - Fatal编程技术网

Jestjs 开玩笑——watch始终运行所有测试

Jestjs 开玩笑——watch始终运行所有测试,jestjs,babel-jest,Jestjs,Babel Jest,我最近从摩卡咖啡转到了开玩笑。除了始终运行所有测试的监视模式(不仅仅是文档中所说的与未限制文件相关的测试),其他一切都正常工作。我已经用谷歌搜索了这些文档,但没有找到关于这个问题的任何信息 我的笑话是 "jest": { "coveragePathIgnorePatterns": [ "/node_modules/", "/generated/", "/mock/", "/tools/", "/transactions/"

我最近从摩卡咖啡转到了开玩笑。除了始终运行所有测试的监视模式(不仅仅是文档中所说的与未限制文件相关的测试),其他一切都正常工作。我已经用谷歌搜索了这些文档,但没有找到关于这个问题的任何信息

我的笑话是

  "jest": {
    "coveragePathIgnorePatterns": [
      "/node_modules/",
      "/generated/",
      "/mock/",
      "/tools/",
      "/transactions/"
    ],
    "coverageThreshold": {
      "global": {
        "branches": 90,
        "functions": 90,
        "lines": 90,
        "statements": 90
      }
    },
    "resetMocks": true,
    "moduleDirectories": [
      "node_modules",
      "src"
    ],
    "moduleNameMapper": {
      "\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/src/__mocks__/fileMock.js",
      "\\.(css|less|scss)$": "<rootDir>/src/__mocks__/styleMock.js"
    },
    "setupTestFrameworkScriptFile": "<rootDir>/tools/setupTest.js"
  },
法律改革委员会:

 "env": {
    "test": {
      "plugins": [
        "rewire",
        "transform-class-properties",
        "transform-es2015-modules-commonjs"
      ],
      "presets": [
        "es2017",
        "react",
        "stage-0",
        "es2015"
      ]
    }
  }
我使用
jest--watch
启动测试,它会打印消息“正在确定要运行的测试套件”,但随后所有测试都会运行,即使没有未被取消限制的文件

我在Windows7上,在powershell中运行该命令。节点版本:
v6.9.1


Jest版本:
“babel Jest”:“20.0.3”
“Jest”:“20.0.4”

老实说,我猜,但是除了Coverage PathIgnorePatterns之外,还可以尝试使用testPathIgnorePatterns。

你运气好吗?我从来没有在那台计算机上工作过。去年10月,我确实换了工作地点,所以我现在有了另一台电脑,它可以工作了……和jest有同样的问题
 "env": {
    "test": {
      "plugins": [
        "rewire",
        "transform-class-properties",
        "transform-es2015-modules-commonjs"
      ],
      "presets": [
        "es2017",
        "react",
        "stage-0",
        "es2015"
      ]
    }
  }