Skip to content

feat(tsconfig): Enable ESM-interoperability. #332

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

codiophile
Copy link

These are the changes I made in my own project to enable ESM interoperability, based on the following advice: octokit/octokit.js#2865 (comment)

I've been using it for several weeks now and it's been working well without any issues. The only problem I've had is that jest didn't play nicely with ESM. I had to add "isolatedModules": true to suppress a warning and so far the best solution I've found for testing ESM with jest is to simply mock the ESM imports and test with mocks instead. This is fine for me, since the ESM dependency I have is Octokit and I don't want to be making http requests to GitHub during testing anyway.

Regardless, it seems better to have ESM interoperability, than not having it, even though it's a bit lacking in the jest environment.

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

Successfully merging this pull request may close these issues.

1 participant