kogosoftwarellc / open-api

A Monorepo of various packages to power OpenAPI in node
MIT License
895 stars 237 forks source link

openapi-framework: dynamic import breaks jest transpile #909

Open coryasilva opened 2 months ago

coryasilva commented 2 months ago

When using jest this code gets transpiled to require and the file URL syntax of the import is not supported and breaks the testing environment.

Why not just use jest's --experimental-vm-modules flag? Glad you asked. Because of this https://github.com/jestjs/jest/issues/11434#issuecomment-1410445848 which is caused by this https://github.com/nodejs/node/issues/37648 which is ultimately caused by this v8 bug

amp5208 commented 1 month ago

confirmed that this is a problem when implementing this in backstage, as well. here is the PR related to the fix, that will need to be pulled in: https://github.com/kogosoftwarellc/open-api/pull/908