- Notifications
You must be signed in to change notification settings - Fork 248
Closed
Labels
Description
Currently the autofixer for jest/prefer-spy-on breaks/changes the behavior of the test by re-implementing the original behavior of the function (which may or may not be wanted).
For example, Date.now = jest.fn() becomes jest.spyOn(Date, 'now'), but it should be jest.spyOn(Date, 'now').mockImplementation(). If a function is provided to jest.fn() it works as expected.