jest-expect-message
jest-expect-message copied to clipboard
Add an optional parameter for muting matcher message
Feature Request
Description:
I would like my test output to display only the custom message I supply to jest-expect-message via the custom matcher, without the rather verbose Jest matcher output (the stack trace). Currently, the custom message simply prepends the regular output and I have to manually replace it once the tests have finished executing (in my use case, the test results are reported to a file).
Would it be possible to allow the custom matcher to pass only the custom message? Ideally, without the "custom message:" block as well, but that's less of an issue.
Possible solution:
We can add a second, optional parameter (such as muteOriginalMessage) with a default value of false inside the wrapMatcher method.
Please let me know if that makes sense, if it does I'd be more than happy to prepare a PR myself.
hi @talbronfer sorry this is a bit late 😅 but should be doable with the latest release with: https://github.com/mattphillips/jest-expect-message#usage