Skip to content

[prefer-spy-on] incorrect autofix Β #1304

@FloEdelmann

Description

@FloEdelmann

The following code gets wrongly autofixed by the jest/spy-on rule:

foo[bar] = jest.fn().mockReturnValue(undefined)

Actual behavior:

jest.spyOn(foo, 'bar').mockImplementation().mockReturnValue(undefined)

Expected behavior:

jest.spyOn(foo, bar).mockImplementation().mockReturnValue(undefined)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions