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

docs: clarify mocking differences with jest #19

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

Conversation

sparten11740
Copy link
Contributor

@sparten11740 sparten11740 commented Dec 17, 2024

Closes #17

@sparten11740 sparten11740 self-assigned this Dec 17, 2024
@mvayngrib mvayngrib requested a review from marcoskichel January 2, 2025 17:09
@mvayngrib
Copy link
Contributor

@marcoskichel you ran into mocking incompatibility issues recently, can you see if this guide suffices for you to get your tests working?

@marcoskichel
Copy link

marcoskichel commented Jan 2, 2025

It helps, but if I am honest I don't think it suffices 😢

If we allow users to implement tests as if using jest, we probably want the tool to behave exactly like it (or at least very close to that).

Is there any technical reason why we can't or don't want to handle hosting like jest does?

@sparten11740
Copy link
Contributor Author

we probably want the tool to behave exactly like it (or at least very close to that).

When using jest ESM, it behaves the same as exodus-test and also requires to import dynamically after the mock has been defined. Hoisting happens only when running jest as CJS (the default)

jest docs for reference

@marcoskichel
Copy link

Oh, really? I wasn't aware 😅 , nevermind me then.

@kewde
Copy link

kewde commented Jan 30, 2025

Thank you, you probably saved me quite some time 🙏

Copy link

@kewde kewde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK - worked for me

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.

document mocking differences with jest
4 participants