Skip to content

Fix Jest test mocks #58

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 2 commits into
base: main
Choose a base branch
from
Open

Fix Jest test mocks #58

wants to merge 2 commits into from

Conversation

facuacostag
Copy link

@facuacostag facuacostag commented Sep 10, 2024

Issue

Version 4.3.0 changed how files were exported in the package.json as you can see in this commit. If you were mocking the library on Jest so tests could pass, the new configuration wasn't allowing Jest to find the package to be mocked.

Screenshot 2024-09-10 at 09 56 34

Solution

Adding require to to each of the exports solves the issue and allows Jest to work again.

@facuacostag
Copy link
Author

@microsoft-github-policy-service agree

@facuacostag facuacostag requested a review from MSNev September 12, 2024 15:05
@EleryanYuri
Copy link

Hello,

My team is facing issue that this PR would solve.
We have a really strict policy about code coverage and being unable to mock the package is a really painfull

Thanks for providing it and I hope this will be soon taken into account.

@MSNev MSNev requested review from Karlie-777 and a team and removed request for MSNev May 15, 2025 16:10
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.

4 participants