-
Notifications
You must be signed in to change notification settings - Fork 467
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
global is not defined #985
Comments
This should be fixed in our |
Using the alpha, the problems appears somewhere else :
|
@JesusTheHun Could you provide a repro? Preferably a cloneable repository. |
I've created a simple vitejs project with a storybook and some tests, but the error doesn't show up. I will try to get a repro but it will probably take a bit of time. |
I spent a lot of time on this and I still can't make it go into error. |
Sounds like an issue with your test setup. Feel free to re-open once you can reproduce the issue. |
@testing-library/dom
version: 7.31.2Running Chrome
What you did:
I tried to use rtl in a vitejs project. This builder uses esbuild, which is a lot more closed to the ECMAScript spec and therefore is more strict.
What happened:
Uncaught ReferenceError: global is not defined at node_modules/@testing-library/dom/node_modules/pretty-format/build/plugins/AsymmetricMatcher.js (AsymmetricMatcher.js:10)
Referencing this line of code :
var Symbol = global['jest-symbol-do-not-touch'] || global.Symbol;
Problem description:
While rtl is supposed to be used by nodejs, the package is by default compiled by esbuild and send to the browser, leading to this error.
Suggested solution:
Despite being unrelated to RTL directly, it would be very convenient if you could simply add a check to make sure
global
exists before going further.The text was updated successfully, but these errors were encountered: