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

sidestep Jest failing when converting to ESM #131

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

Conversation

inverted-capital
Copy link

Over here there's a bit of a kafuffle around the way that Jest is resolving modules.

When trying to import ipfs-core using ESM inside Jest tests, it breaks because Jest seems to get confused when module.exports and require are part of the same expression. Breaking it up as proposed makes the problem go away.

Over [here](jestjs/jest#9771) there's a bit of a kafuffle around the way that Jest is resolving modules.

When trying to import `ipfs-core` using ESM inside Jest tests, it breaks because Jest seems to get confused when `module.exports` and `require` are part of the same expression.  Breaking it up as proposed makes the problem go away.
@julienmalard
Copy link

Thank you @inverted-capital ; works great for me! I'm using a resolution to your patch while waiting for the pull request to be accepted.

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.

2 participants