oas tools module import issue when doing tests with jest

278 Views Asked by At

I ran into this issue "You need to run with a version of node that supports ES Modules in the VM API. See https://jestjs.io/docs/ecmascript-modules" enter image description here which is because of the import of modules in the node_modules/@oas-tools/core/src/entrypoint.cjs:1:98 enter image description here my node version is 16.19.0, I tried version 18, still the same.

Also tried the suggested solution by https://jestjs.io/docs/ecmascript-modules, still not worked.

here is my .jest.config.ts file enter image description here

Could anyone help with this?

Cheers.

I expect the import of these two files wouldn't cause problem when doing tests with jest. enter image description here

0

There are 0 best solutions below