Open luiz290788 opened 1 year ago
Any updates on this?
@luiz290788 @ckrauterlovescoffee this is a bug with Jest. After debugging I found out that Jest never asks ts-jest
to process custom testEnvironment
file in ESM mode.
A workaround is that the test environment file has to be written with .js
extension instead
Version
29.1.1
Steps to reproduce
NODE_OPTIONS="--experimental-vm-modules" npx jest
test will fail with message:
Expected behavior
Expect the
testEnvironment
to be transpiled as expected using ESM.Actual behavior
testEnvironment
is transpiled as commonjsDebug log
I tried to post the logs but github complained saying it was too long.
Additional context
It looks like the transpilation happens normally for the tests but the
useESM
is not affecting thetestEnvironment
.Environment