Skip to content
New issue

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

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

Already on GitHub? # to your account

fix: don't show premature access warning on ES Module import #119

Merged
merged 1 commit into from
Nov 21, 2023

Conversation

germanescobar
Copy link
Contributor

We had a bunch of the following warnings when tests were starting up:

If you want to access Prisma client in beforeAll or afterAll, use jestPrisma.originalClient.
jsetPrisma.client should be used in test or beforeEach functions because transaction has not yet started.

The culprit was the ES Module system that asks for a property called __esModule on the proxied instance every time we import the module.

The changes in this PR are the following:

  • Only show the warning if the property name is not __esModule.
  • Fix the spelling in the warning from jsetPrisma to jestPrisma.

@Quramy Quramy merged commit eb9b3d1 into Quramy:main Nov 21, 2023
@Quramy
Copy link
Owner

Quramy commented Nov 21, 2023

@germanescobar Thanks for your PR !

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

Successfully merging this pull request may close these issues.

2 participants