我正在使用
Jest 21.2.1
运行react应用程序的测试。奇怪的是当我跑步的时候
jest --watch
(如上所述
here
)为了观察测试用例的任何变化,我得到了如下错误
Determining test suites to run...Error: This promise must be present when running with -o.
我试图检查Jest CLI,发现该函数需要两个参数,其中一个是promise,在本例中没有传递(不确定如何传递)。可能是缺少配置?
任何建议都有助于解决这个问题。
getTestPaths(
globalConfig,
changedFilesPromise)
{var _this2 = this;return _asyncToGenerator(function* () {
const paths = globalConfig.nonFlagArgs;
if (globalConfig.onlyChanged) {
if (!changedFilesPromise) {
throw new Error('This promise must be present when running with -o.');
}
return _this2.findTestRelatedToChangedFiles(changedFilesPromise);
}
注:可能与报告的问题有关
here
.