Subscribe on changes!

Mounting element refers to SVGElement directly

avatar
Mar 29th 2021

Version

3.0.9

Reproduction link

https://gist.github.com/asmnh/7b00c26c2ef028111cf3257f2fc3c5a0

Steps to reproduce

  1. Create new Vue3 project with unit tests enabled using vue cli - settings profile .vuerc attached as reproduction link.
  2. Run npm run test:unit

What is expected?

Sample test passes.

What is actually happening?

Sample test fails with ReferenceError: SVGElement is not defined.

  HelloWorld.vue
    1) renders props.msg when passed


  0 passing (81ms)
  1 failing

  1) HelloWorld.vue
       renders props.msg when passed:
     ReferenceError: SVGElement is not defined
      at Object.app.mount (dist/js/webpack:/node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js:1253:1)
      at mount (dist/js/webpack:/node_modules/@vue/test-utils/dist/vue-test-utils.esm-bundler.js:2310:1)
      at shallowMount (dist/js/webpack:/node_modules/@vue/test-utils/dist/vue-test-utils.esm-bundler.js:2329:1)
      at Context.it (dist/js/webpack:/tests/unit/example.spec.js:8:1)

Error was introduced in 3.0.8 and affects only using Vue components in node environment - running application in browser works correctly.

avatar
Mar 30th 2021

+1