-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
Cannot find module '_isMockFunction' #175548
Comments
This is caused by Jest trying to check a property on every global. Which is questionable in a world where WeakSet exists. That is then triggers a proxy getter and causes this error. @alexdima not sure if you want to do anything here |
@idahogurl downgrading to Jest 27.5.1 fixed this for me, I don't know specifically what version this got added in but a revert does fix it. |
I put together a PR to work around this for jest: jestjs/jest#14188 I also have a workaround you can do locally. In your start.ts (or whatever script you point to with declare global {
var _VSCODE_NODE_MODULES: any;
}
if (globalThis._VSCODE_NODE_MODULES) {
globalThis._VSCODE_NODE_MODULES = new Proxy(globalThis._VSCODE_NODE_MODULES, {
get(target, p, receiver) {
if (p === "_isMockFunction") return undefined;
return Reflect.get(target, p, receiver);
}
});
} This wraps the |
Did this get fixed in jest or is this still an issue? |
This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines. Happy Coding! |
Description
Starting with VS Code 1.74.1, I get the following error when running tests using Jest. It works with VS Code 1.73.1
Reproduction
yarn
to install node modulesyarn test
This may be a VS Code issue.
The text was updated successfully, but these errors were encountered: