Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prefer-spy-on fix breaks/changes tests #389

Closed
chrisblossom opened this issue Aug 12, 2019 · 1 comment · Fixed by #390
Closed

prefer-spy-on fix breaks/changes tests #389

chrisblossom opened this issue Aug 12, 2019 · 1 comment · Fixed by #390
Labels

Comments

@chrisblossom
Copy link
Contributor

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.

@SimenB
Copy link
Member

SimenB commented Aug 12, 2019

🎉 This issue has been resolved in version 22.15.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants