-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Libraries that use Symbol properties on builtin prototypes break in Jest #4603
Comments
Wish it would jest work! 👯👏😂👍 |
Jest tests run in JSDOM. JSDOM uses Node.js VM to run tests in isolation with window object. Unfortunately, modules imported by I created a "jest": {
"testRegex": "(/tests/.*|\\.(test|spec))\\.(js)$",
"setupTestFrameworkScriptFile": "<rootDir>/test-setup.js"
} Inside of There are several related issues in Node & Jest repoes |
Is there a workaround for this? I.e. to direct jest to say which modules should be run in the VM context? |
This issue is stale because it has been open for 1 year with no activity. Remove stale label or comment or this will be closed in 30 days. |
good times! |
This issue is stale because it has been open for 1 year with no activity. Remove stale label or comment or this will be closed in 30 days. |
This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one. |
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. |
Do you want to request a feature or report a bug?
bug
What is the current behavior?
Libraries that add
Symbol
s to builtins likeObject.prototype
andArray.prototype
for unique, anonymous properties break using Jest.If the current behavior is a bug, please provide the steps to reproduce and either a repl.it demo through https://repl.it/languages/jest or a minimal repository on GitHub that we can
yarn install
andyarn test
.demonstration of the problem
What is the expected behavior?
Symbol properties can be added to builtin prototypes. This works IRL in node, browser, and other testing frameworks.
Please provide your exact Jest configuration and mention your Jest, node, yarn/npm version and operating system.
The text was updated successfully, but these errors were encountered: