You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
chrisblossom
added a commit
to chrisblossom/eslint-plugin-jest
that referenced
this issue
Aug 12, 2019
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()
becomesjest.spyOn(Date, 'now')
, but it should bejest.spyOn(Date, 'now').mockImplementation()
. If a function is provided tojest.fn()
it works as expected.The text was updated successfully, but these errors were encountered: