在运行玩笑时试图找出此错误的来源:
TypeError: (0 , (_jestUtil || _load_jestUtil(...)).validateCLIOptions) is not a function我的目录结构:
root
-test
--spec-files
---*.js我的包中的Dev依赖关系:
"devDependencies": {
"babel-eslint": "6.1.2",
"babel-jest": "22.1.0",
"chai": "3.5.0",
"chai-as-promised": "5.3.0",
"eslint": "2.13.1",
"eslint-config-airbnb": "6.2.0",
"eslint-plugin-react": "4.3.0",
"jest": "22.1.4",
"jest-cli": "22.1.4",
"jest-runner-eslint": "0.4.0",
"nodemon": "1.12.1",
"nyc": "11.2.1",
"sinon": "2.4.1",
"snyk": "1.69.10",
"spec-xunit-file": "0.0.1-3",
"supertest": "1.2.0",
"supertest-as-promised": "3.2.0",
"xunit-file": "0.0.9"
}jest.config.js:
module.exports = {
estPathIgnorePatterns: [
'<rootDir>/bower_components/',
'<rootDir>/node_modules/',
'<rootDir>/gulp-tasks/',
],
testMatch: ['<rootDir>/test/spec-files/*.js'],
globalSetup: '<rootDir>/test/setup.js',
};跑步:
./node_modules/.bin/jest --testPathPattern=test/spec-files/.*\\.js$我只注意到一个与这种类型的bug相关的问题:https://github.com/facebook/jest/issues/5740
原因似乎是有一个无效的testPathPattern,但这似乎不是我的情况。
发布于 2018-05-22 17:43:24
更新jest和jest-cli,以解决以下问题:
"jest": "22.4.4",
"jest-cli": "22.4.4",https://stackoverflow.com/questions/50377017
复制相似问题