You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there. Another adventurer trying to migrate from babel-jest to esbuild-jest. I'm noticing that many tests which use jest.mock are failing with:
Do not import `@jest/globals` outside of the Jest test environment
Sometimes moving the jest.mock() call inside the describe() block helps resolve the issue, but other times not. Seems like babel-jest was more flexible about where mocking can occur. Any tips on how we can update our tests to avoid these issues?
The text was updated successfully, but these errors were encountered:
Hi there. Another adventurer trying to migrate from
babel-jest
toesbuild-jest
. I'm noticing that many tests which usejest.mock
are failing with:Sometimes moving the
jest.mock()
call inside thedescribe()
block helps resolve the issue, but other times not. Seems likebabel-jest
was more flexible about where mocking can occur. Any tips on how we can update our tests to avoid these issues?The text was updated successfully, but these errors were encountered: