vuejs / test-utils

Vue Test Utils for Vue 3
https://test-utils.vuejs.org
MIT License
1.04k stars 244 forks source link

Bug: #2106

Closed skeezrxcco closed 1 year ago

skeezrxcco commented 1 year ago

Describe the bug After updating npm all my tests using vue test utils broke (updating from 2.3.2 => 2.4.0)

To Reproduce run tests

Expected behavior to have tests passing but now i have a lot of errors pertaining to the VueWrapper and DOMWrapper. eg:

 ❯ Object.get node_modules/@vue/test-utils/dist/vue-test-utils.esm-bundler.mjs:1517:27
    1515|                     return function () { return false; };
    1516|                 default:
    1517|                     throw new Error("Cannot call ".concat(String(prop), " on an empty ").concat(wrapperType, "."));

package.json

  "dependencies": {
  etc..
    "happy-dom": "^8.9.0",
},
"devDependencies":{
        "vitest": "^0.29.3",
         "vue": "^3.2.41",
        "vite": "^3.1.8",
         "@vue/test-utils": "^2.4.0",
         etc...
}

To bandage this we downgraded the version. Could someone give advice on this situation?

cexbrayat commented 1 year ago

It's hard to say without more information.

Can you provide us a small repro online using https://stackblitz.com/github/vuejs/create-vue-templates/tree/main/typescript-vitest?file=src%2Fcomponents%2F__tests__%2FHelloWorld.spec.ts ?

It only takes a few minutes, and we'll be able to take a look

cexbrayat commented 1 year ago

We had no answer from the OP. If the issue persists, feel free to ping me with a repro and I'll take a look