Pattern: Use of Jest method alias
Issue: -
Using aliased method names instead of their canonical names reduces code consistency and makes searching for method usage more difficult. These aliases will be removed in future Jest versions.
Example of incorrect code:
expect(fn).toBeCalled();
expect(fn).toBeCalledWith();
expect(fn).toReturn();
expect(fn).toThrowError();
Example of correct code:
expect(fn).toHaveBeenCalled();
expect(fn).toHaveBeenCalledWith();
expect(fn).toHaveReturned();
expect(fn).toThrow();