-
-
Notifications
You must be signed in to change notification settings - Fork 8.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
fix: should prefix ShadowRoot
with window.
#2943
Conversation
Otherwise this expression would throw in environments that does not support `ShadowRoot` which includes the common mocha testing environment setup that uses `jsdom` and `jsdom-global`. It is because `ShadowRoot` is not an enumerable property on `window`, `jsdom-global` fails to expose it on the `global` object. See the error message at: https://app.circleci.com/pipelines/github/vuejs/vue-cli/779/workflows/17d7d7c4-7605-4588-878a-ddb3a6d37102/jobs/24147
Hi everyone, any thoughts on when this will be merged in master? Quite keen for this bugfix. TIA |
Hi everyone! I'm running into an error related to this when trying to run a simple test using typescript. I've come up with a minimum repo to reproduce this case at https://github.com/jjdive/vite-vue-ts-tests-error. Anyways, this is the error i get and it points to Thanks in advance for any help with this! |
@jjdive I'm on my phone so I can't test it. But here's my guess: |
You can either update your jest version or change the configuration to use a different testEnvironment, like what we do in Vue CLI v4 https://github.com/vuejs/vue-cli/blob/b0de229e78ae860c6ebc1e53f4bb481d7549cde7/packages/%40vue/cli-plugin-unit-jest/presets/default/jest-preset.js#L21 |
@sodatea, you're totally right!
and the sample test runs without issues (i know this might lead to errors at some point so i'll be looking forward to any vue-jest and the other deps updates). Thank you very much for pointing me to the right dep update needed! |
Otherwise this expression would throw in environments that do not
support
ShadowRoot
, including the common mocha testing environmentsetup that uses
jsdom
andjsdom-global
.It is because
ShadowRoot
is not an enumerable property onwindow
,jsdom-global
fails to expose it on theglobal
object.See the error message at https://app.circleci.com/pipelines/github/vuejs/vue-cli/779/workflows/17d7d7c4-7605-4588-878a-ddb3a6d37102/jobs/24147