Support ESM
Are you using OpenAPI 2, 3.0.X, or 3.1.0? All of them
Would this solve a problem or make something easier? Solve a problem
What would you like to happen?
I'd be able to import jest-openpi in ESM module like this:
import jestOpenApi from 'jest-openapi';
jestOpenApi(..);
Describe alternatives you've considered use it like this:
import jestOpenAPI from 'jest-openapi';
// @ts-expect-error - jest-openapi types doesn't properly support esm
jestOpenAPI.default(join(process.cwd(), './docs/oas3.json'));
// @ts-expect-error - jest-openapi types doesn't properly support esm
expect(res).toSatisfyApiSpec();
Additional context or screenshots
Are you going to resolve the issue? I'd love to, but I need some guidance on how we want to do this.
hey @mikicho thanks for suggesting this 🙂 I'm not sure what we need to do to import jest-openapi in an ESM module. Happy for you to suggest how it should be done, if you have time and know how to.
Otherwise I will look at it later (but can't right now as I'm quite busy at work)
I'll try to figure it out
Hello @mikicho @rwalle61 do you have news about this issue? I'm not able to use latest jest-openapi version with ESM. Maybe you know a workaround while waiting for permanent solution?
Unfortunately, no proper solution