我尝试按照Jest文档中的页面在TypeScript类Consumer上测试方法。这个类实例化一个Provider对象并调用它的方法,所以我想模拟一下Provider类。/js/consumers/Consumer";
jest.mock("../..Provider is not a constructor
在Jest测试中给出了以下内容。');
mockReaddirSync.mockReturnValue(mockDirListing); TypeScript将显示以下错误: Argument of type 'string[]' isType 'string' is not assignable to type 'Dirent'.ts(2345) 模拟实例的类型为 jest.SpyInstance<fs.Dirent[], [f