jest/prefer-called-with 样式
作用
建议使用 toBeCalledWith()
或 toHaveBeenCalledWith()
示例
javascript
// valid
expect(noArgsFunction).toBeCalledWith();
expect(roughArgsFunction).toBeCalledWith(expect.anything(), expect.any(Date));
expect(anyArgsFunction).toBeCalledTimes(1);
expect(uncalledFunction).not.toBeCalled();
// invalid
expect(someFunction).toBeCalled();
expect(someFunction).toHaveBeenCalled();