Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support ESM #265

Open
mikicho opened this issue Jan 11, 2022 · 4 comments
Open

Support ESM #265

mikicho opened this issue Jan 11, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@mikicho
Copy link

mikicho commented Jan 11, 2022

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.

@mikicho mikicho added the enhancement New feature or request label Jan 11, 2022
@rwalle61
Copy link
Collaborator

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)

@mikicho
Copy link
Author

mikicho commented Jan 17, 2022

I'll try to figure it out

@ypolishchuk-ledger
Copy link

ypolishchuk-ledger commented Jun 21, 2023

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?

@mikicho
Copy link
Author

mikicho commented Jun 21, 2023

Unfortunately, no proper solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants