Skip to content

Function mocks with jest.fn() have their types flipped #23

@jeparlefrancais

Description

@jeparlefrancais

There is an issue with the type definition of jest.fn() in the jest-mock package. The types T... and Y... are being flipped from arguments to return values!

export type JestFuncFn = <T..., Y...>(implementation: ((Y...) -> T...)?) -> (MockFn, (T...) -> Y...)
-- should be
export type JestFuncFn = <T..., Y...>(implementation: ((T...) -> Y...)?) -> (MockFn, (T...) -> Y...)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions