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

Work with jest out of the box #4

Open
sleexyz opened this issue Jan 29, 2018 · 0 comments
Open

Work with jest out of the box #4

sleexyz opened this issue Jan 29, 2018 · 0 comments

Comments

@sleexyz
Copy link
Owner

sleexyz commented Jan 29, 2018

Right now reloady doesn't work when run within jest with babel. require seems to get hijacked, and deleting require.cache doesn't do anything.

Jest hijacks require and binds the actual require module to requireActual, so instead we need to

  1. detect that we're running in jest
  2. clear the actual require cache

This is necessary to be able to be used in browser tests written in jest.

@sleexyz sleexyz changed the title Work with jest + babel out of the box Work with jest out of the box Jan 29, 2018
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

No branches or pull requests

1 participant