Given the following code:
foo.bar = jest.fn().mockImplementation(baz => baz)
The jest/prefer-spy-on rule autofixes this to:
jest.spyOn(foo, 'bar').mockImplementation().mockImplementation(baz => baz)
The mockImplementation should rather be deduplicated. Expected autofix:
jest.spyOn(foo, 'bar').mockImplementation(baz => baz)
Given the following code:
The
jest/prefer-spy-onrule autofixes this to:The
mockImplementationshould rather be deduplicated. Expected autofix: