Open jaybe78 opened 2 years ago
Thanks for the kind words and for the self-reply! Really glad it was helpful, it took me a long time to figure it out too!
Any idea why I would get
require() of `/fileX` from `fileY` is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
whereas when I look into my fileY.ts
I only have import
there and no require
at all ?
FileX
is a ts
file coming from an ES module that I import in my main app
Hello Thanks for putting this boilerplate together. I've been banging my head against the wall to use es module with jest, tried everything and always fieled. Been stuck on this for days but stumbled upon your work, which helped finding out my code is failing because I use
"ts-node": "^10.4.0"
, you use9.1.1
and it works.Any idea what's changed between 9 and 10 ?
EDIT:
I've found out this is related to this https://github.com/facebook/jest/issues/11453
You have to rename
jest.config.ts
tojestconfig.cjs