-
Notifications
You must be signed in to change notification settings - Fork 265
Getting a "ShadowRoot is not defined" error #293
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
Comments
@peripateticus Thanks for opening an issue This is indeed a problem with vue-next and not in vue-test-utils-next, and you're intuition is right. The good news is that there is already a fix ready to merge vuejs/core#2943 I'm going to close this issue, as there is nothing we can do on VTU-next side. |
Excellent, thank you for the quick response and pointing me to the fix on this, @cexbrayat! 👍 |
fixes an issue in browsers where ShadowRoot is not available globally (e.g. Edge 18). Error message is "ShadowRoot is not defined". A similar issue was reported here vuejs/test-utils#293 and the fix was referencing ShadowRoot from window instead: https://github.com/vuejs/core/pull/2943/files
* fix: access ShadowRoot via window.ShadowRoot fixes an issue in browsers where ShadowRoot is not available globally (e.g. Edge 18). Error message is "ShadowRoot is not defined". A similar issue was reported here vuejs/test-utils#293 and the fix was referencing ShadowRoot from window instead: https://github.com/vuejs/core/pull/2943/files * Revert accidentally changed return value
* fix: access ShadowRoot via window.ShadowRoot fixes an issue in browsers where ShadowRoot is not available globally (e.g. Edge 18). Error message is "ShadowRoot is not defined". A similar issue was reported here vuejs/test-utils#293 and the fix was referencing ShadowRoot from window instead: https://github.com/vuejs/core/pull/2943/files * Revert accidentally changed return value
* fix: access ShadowRoot via window.ShadowRoot fixes an issue in browsers where ShadowRoot is not available globally (e.g. Edge 18). Error message is "ShadowRoot is not defined". A similar issue was reported here vuejs/test-utils#293 and the fix was referencing ShadowRoot from window instead: https://github.com/vuejs/core/pull/2943/files * Revert accidentally changed return value
Hello!
So, we are in the process of upgrading Vue 2 -> 3 and, for unit tests, we use a combination of mochapack and
@vue/test-utils
for unit testing. Currently, I'm testing with@vue/test-utils@2.0.0-beta.14
.What is happening is that when I mount the component in the
mocha
spec file, I hit this error:Looking at the error stack at line 1261 in the
@vue/runtime-dom/dist/runtime-dom.cjs.js
code, it says thatShadowRoot
is undefined. So, in the code, if I change that to awindow.ShadowRoot
, it's happy. I see thatwindow.ShadowRoot
exists whenJSDOM
is set up, prior to when the tests run.Any ideas? Thanks for the help!
The text was updated successfully, but these errors were encountered: