无法读取gulp-jest中未定义的属性“ runCLI”

时间:2020-04-14 16:11:40

标签: gulp jestjs gulp-jest

我正在尝试使用gulp-jest对gulp运行笑话测试。 从npm安装了这些软件包:

ansible@srv-prod-lnx01:~$ ansible -m win_ping srv-prp-tb01c
srv-prp-tb01c | UNREACHABLE! => {
    "changed": false,
    "msg": "credssp: Server did not response with a CredSSP token after step Step 1. TLS Handshake - actual 'Negotiate, Kerberos, CredSSP'",
    "unreachable": true
}

ansible@srv-prod-lnx01:~$ unset HTTP_PROXY

ansible@srv-prod-lnx01:~$ ansible -m win_ping srv-prp-tb01c
srv-prp-tb01c | SUCCESS => {
    "changed": false,
    "ping": "pong"
}

开玩笑地提供了以下配置:

"gulp-jest": "^4.0.3", 
"jest-cli": "^25.3.0"

我已经在gulpfile.js中编写了一个基本方法,称为this link

"jest": {
    "setupFilesAfterEnv": [
      "<rootDir>/jest.setup.js"
    ],
    "collectCoverage": true,
    "coverageDirectory": "./test/unit-test-coverage",
    "coverageReporters": [
      "text",
      "lcov"
    ]
  }

但是,运行gulp任务时出现以下错误:

TypeError:无法读取未定义的属性'runCLI'

1 个答案:

答案 0 :(得分:5)

上个星期五我遇到了同样的麻烦,要解决它,我最终不得不降级jest-cli的版本:

“ @ types / jest”:“ 24.9.0”, “ jest”:“ 24.9.0”, “ ts-jest”:“ 24.3.0 “ jest-cli”:“ 24.9.0”, “ jest-html-reporter”:“ 2.5.0”,

Jest-cli新版本中已知的错误

->考虑删除所有的node_modules和package_lock.json!

祝你好运;)