I eventually found out what the problem was. It turns out it was there in ts-jest’s README all the time.
There’s a section in the README titled Using ES2015+ features in Javascript files. In these cases, you need to instruct jest to use babel-jest as a transform for .js files.
"jest": {
"transform": {
"^.+\\.jsx?$": "babel-jest", // Adding this line solved the issue
"^.+\\.tsx?$": "ts-jest"
},
// ...
},