Skip to content
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

[Bug Report] ReferenceError: IntersectionObserver is not defined in tests with vuetify 2.5.0 #13644

Closed
josephlbarnett opened this issue May 12, 2021 · 0 comments
Assignees
Labels
T: bug Functionality that does not work as intended/expected testing
Milestone

Comments

@josephlbarnett
Copy link

Environment

Vuetify Version: 2.5.0
Last working version: 2.4.11
Vue Version: 2.6.12
Browsers: Firefox 88.0
OS: Linux

Steps to reproduce

With vuetify 2.5.0, jest tests have started failing with ReferenceError: IntersectionObserver is not defined when mounting components.

An example stacktrace:

    ReferenceError: IntersectionObserver is not defined

      29 |   mockRouter = { push: jest.fn() }
      30 | ) {
    > 31 |   return mount(Login, {
         |          ^
      32 |     stubs: ["router-view", "v-snackbar", "router-link"],
      33 |     apolloProvider: new VueApollo({
      34 |       defaultClient: mockClient,

      at fn (node_modules/vuetify/dist/vuetify.js:33341:18)
      at callHook$1 (node_modules/vue/dist/vue.runtime.common.dev.js:6658:7)
      at apply (node_modules/vue/dist/vue.runtime.common.dev.js:6597:9)
      at apply (node_modules/vue/dist/vue.runtime.common.dev.js:2231:10)
      at invokeWithErrorHandling (node_modules/vue/dist/vue.runtime.common.dev.js:1850:26)
      at Object.insert (node_modules/vue/dist/vue.runtime.common.dev.js:2171:9)
      at invokeInsertHook (node_modules/vue/dist/vue.runtime.common.dev.js:6326:28)
      at VueComponent.__patch__ (node_modules/vue/dist/vue.runtime.common.dev.js:6543:5)
      at VueComponent._update (node_modules/vue/dist/vue.runtime.common.dev.js:3933:19)
      at VueComponent.call (node_modules/vue/dist/vue.runtime.common.dev.js:4054:10)
      at Watcher.get (node_modules/vue/dist/vue.runtime.common.dev.js:4465:25)
      at new Watcher (node_modules/vue/dist/vue.runtime.common.dev.js:4454:12)
      at mountComponent (node_modules/vue/dist/vue.runtime.common.dev.js:4061:3)
      at VueComponent.$mount (node_modules/vue/dist/vue.runtime.common.dev.js:8392:10)
      at mount (node_modules/@vue/test-utils/dist/vue-test-utils.js:14062:21)
      at mountLogin (tests/unit/components/Login.spec.ts:31:10)
      at Object.<anonymous> (tests/unit/components/Login.spec.ts:49:19)

Installing intersection-observer does not appear to fix.

Was also getting ReferenceError: ShadowRoot is not defined, but installing jest >= 26 (24 was getting installed with previous package.json) appears to have fixed that per comments in vuejs/core#2943

Expected Behavior

tests pass

Actual Behavior

tests fail

Reproduction Link

https://github.com/josephlbarnett/quizzy/tree/dependabot-npm_and_yarn-client-vuetify-2.5.0/client
build log

@ghost ghost added the S: triage label May 12, 2021
@KaelWD KaelWD added T: bug Functionality that does not work as intended/expected testing and removed S: triage labels May 12, 2021
@KaelWD KaelWD self-assigned this May 12, 2021
@KaelWD KaelWD added this to the v2.5.x milestone May 12, 2021
@KaelWD KaelWD closed this as completed in b04dbba May 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T: bug Functionality that does not work as intended/expected testing
Projects
None yet
Development

No branches or pull requests

2 participants