[Bug]: result.message is not a function
See original GitHub issueVersion
27.x.y
Steps to reproduce
Given a super basic test simple calc function that returns sum of two values…
it("EXPECTS: to get fail messages", ()=> {
let calc = (a, b) => a + b;
expect(calc(1,2)).toEqual(4);
})
Expected behavior
if the expected value isn’t met - then I would expect a message we gave a verbose breakdown of expected and actual values (see below for output as run using Jest 26.x.y
)
Actual behavior
now, when running tests, where failures occur - rather than getting detailed output of expected and actual results; the console is only able to display a TypeError: result.message is not a function
message
Additional context
No response
Environment
System:
OS: macOS Mojave 10.14.6
CPU: (4) x64 Intel(R) Core(TM) i7-6567U CPU @ 3.30GHz
Binaries:
Node: 12.0.0 - ~/.nvm/versions/node/v12.0.0/bin/node
Yarn: 1.21.1 - /usr/local/bin/yarn
npm: 6.9.0 - ~/.nvm/versions/node/v12.0.0/bin/npm
npmPackages:
jest: ^27.2.4 => 27.2.4
Issue Analytics
- State:
- Created 2 years ago
- Comments:8
Top Results From Across the Web
TypeError: result.message is not a function · Issue #34 - GitHub
Hi, From what I see in chain.js, the JestAssertionError constructor considers result.message as a function when its actually a string. At ...
Read more >any Jest test fails with "result.message is not a function" after ...
After upgrading Jest to v.27.2.5 from v.26 if a test fails it shows me: result.message is not a function.
Read more >TypeError: "x" is not a function - JavaScript - MDN Web Docs
The JavaScript exception "is not a function" occurs when there was an attempt to call a value from a function, but the value...
Read more >How to Handle JavaScript Uncaught TypeError: “x” is Not a ...
The Javascript TypeError: "x" is not a function occurs when calling a function on a value or object, which is not actually a...
Read more >How to solve the "is not a function" error in JavaScript
js we use require() to load external modules and files. This can cause, in some cases, an error like this: TypeError: require(...) is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
hmmm - interesting.
So I did that (repos updated) and behavior is as expected. Suggests the problem is with
ts-jest
…** update ** (mainly for others that might stumble/land here in the future) bit more tinkering around this, suggests it’s not even
ts-jest
- but actually injest-chain
as removing it from the typescript version delivers the expected behaviorsee - https://github.com/mattphillips/jest-chain/issues/34
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.