jest-expect-message: "TypeError: matcherResult.message is not a function" after upgrade jest to latest version (27.0.3)

Bug

“TypeError: matcherResult.message is not a function” exception after upgrade jest to latest version (27.0.3)

npx envinfo --preset jest

System: OS: Windows 10 10.0.19043 CPU: (6) x64 Intel® Core™ i5-8400 CPU @ 2.80GHz Binaries: Node: 14.16.0 Yarn: 1.22.5 npm: 6.14.11 npmPackages: jest: ^27.0.3 => 27.0.3 jest-expect-message: 1.0.2

Relevant code or config

module.exports = {
  preset: 'ts-jest',
  reporters: [
    'default',
    'jest-html-reporters',
  ],
  runner: 'groups',
  setupFilesAfterEnv: ['jest-expect-message'],
};


What you did: upgrade jest to latest version 27.0.3

What happened (please provide anything you think will help): when expect was failed instead receive custom message with error text i’m receive exception:

TypeError: matcherResult.message is not a function

Reproduction repository (if possible): yarn install jest@27.0.3

expect(false, "false can't be true").toBe(true);

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 35
  • Comments: 17 (8 by maintainers)

Commits related to this issue

Most upvoted comments

i’m publishing package @alex_neo/jest-expect-message check pls connect to project as

  setupFilesAfterEnv: ['@alex_neo/jest-expect-message'],

Sorry for the delay in coming to this!!! I’ve just published a new version with the fix for this in: https://www.npmjs.com/package/jest-expect-message/v/1.0.4

still getting the issue

Better a year late than never! Thank you. 🙂

@alexneo2003 can you please contribute your code to the main package here? @mattphillips are you looking into this problem?

The PR is open for like 4 months: https://github.com/mattphillips/jest-expect-message/pull/40