Skip to content

[unbound-method]: don't report unbound methods passed to jest.mocked #1596

Closed
@FloEdelmann

Description

@FloEdelmann
import foo from './foo'

jest.mock('./foo')

jest.mocked(foo.bar).mockResolvedValue(baz)
//          ^^^^^^^ jest/unbound-method reports an error here

expect(foo.bar).toHaveBeenCalled() // no error here

Since jest.mocked will be called with mock functions, it should not make a difference whether it is bound or not, right? So I'd suggest to not report an error for unbound methods passed to jest.mocked, just like already happens when passing it to expect.

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