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

[Bug]: failed to clear require cache #12106

Closed
xkn1ght opened this issue Dec 1, 2021 · 4 comments · Fixed by #12531
Closed

[Bug]: failed to clear require cache #12106

xkn1ght opened this issue Dec 1, 2021 · 4 comments · Fixed by #12531

Comments

@xkn1ght
Copy link

xkn1ght commented Dec 1, 2021

Version

27.4.2

Steps to reproduce

  1. clone my repo [email protected]:xkn1ght/jest-require.git
  2. pnpm install
  3. pnpx jest ./index.spec.js

Expected behavior

Expect to see require a totally different module, but I get the same value a = 1.
However, the refenence‘s expect works, as the doc said: https://jestjs.io/docs/jest-object#jestresetmodules

Actual behavior

Should it be any way to clear require cache

Additional context

No response

Environment

Node: 14.17.4
os: Darwin
@Knaackee
Copy link

Knaackee commented Feb 5, 2022

@TrickyPi
Copy link
Contributor

TrickyPi commented Mar 2, 2022

Currently, jest does not support this feature, but i think it could be supported.

@SimenB
Copy link
Member

SimenB commented Mar 6, 2022

@github-actions
Copy link

github-actions bot commented Apr 6, 2022

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
4 participants