【发布时间】:2021-04-30 15:40:01
【问题描述】:
我正在使用 Jest 21.2.1 来运行我的反应应用程序测试。奇怪的是,当我运行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 报告的问题有关。
【问题讨论】:
标签: javascript reactjs tdd jestjs