Skip to content

Export withMessage for manual patchingΒ #74

@Helveg

Description

@Helveg

Not all testing setups are born equal. Some are fidgety, and import 'jest-expect-message' does not successfully apply the patch. It would help if withMessage was exported, perhaps as patchJestExpectWithMessage, so that I can apply the patch myself.

Currently I have to do this in my setupAfterEnv:

// @ts-ignore: ignore withMessage missing from declarations
import withMessage from 'jest-expect-message/dist/withMessage.js';

// @ts-ignore: patch jest expect
global.expect = withMessage(expect);

which is fine 🀷 Could perhaps also a expectWithMessage function be added that instead of monkey-patching the expect function simply calls it with the wrapping logic applied once?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions