因此,我有一个简单的快速路由,我正在尝试使用Jest进行测试。下面是代码片段 auth.route.ts import * as authController from '..expect(jest.fn()).toHaveBeenCalled()
Received number of calls: 0 我让它工作的一种方法是重写我的路线,如下所示,但我认为这不是正确的方式 import * as au
假设我正在使用Jest对两个相同类型的数组进行断言,将它们称为actual和expected。使用arrayContaining匹配器,可以很容易地测试expected中的所有元素都在actual中 test('ALL elements in expected are in actual', (expect.arrayContaining(willPass))
expect(actual).toEqual(expect.arrayContaining(will