我想对存根进行单元测试,它会抛出超时异常/承诺拒绝,错误代码为ECONNABORTED。但是,每当我尝试在使用moxios模拟之后调用api时,我都会得到这样的错误:Timeout - Async callback was not invoked within timeout specifiedPS:使用Jest作为我的测试运行。
我在react应用程序的单元测试用例中遇到过这样的情况:在一个函数中调用从父组件接收的props中的另一个函数。const { finalSave, onClose } = this.props;onClose();return true;现在,当我对已执行的进行测试时,它会抛出错误“Cannot read property then of undefined”,测试如下
con