question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug: vue jest utils, shallowMount does not work when property values are symbols

See original GitHub issue

Prerequisites

Ionic Framework Version

  • v4.x
  • v5.x
  • v6.x

Current Behavior

After bumping Ionic Vue from v5 to v6 RC, all my tests that are shallowMounted fail with the following error:

Screen Shot 2021-11-08 at 09 41 06

Expected Behavior

This didn’t happen with v5, and I expect it to work in v6 as well

Steps to Reproduce

Run an Ionic 6 app test with shallowMount

Code Reproduction URL

No response

Ionic Info

Ionic:

Ionic CLI : 6.17.1

Utility:

cordova-res : not installed globally native-run : not installed globally

System:

NodeJS : v17.0.1 npm : 8.1.0 OS : macOS Monterey

Additional Information

Also see https://github.com/vuejs/vue-test-utils/issues/1833

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:29 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
lmiller1990commented, Nov 18, 2021

We actually found a way to fix this in Vue core if anyone is curious: https://github.com/vuejs/vue-next/pull/4964

1reaction
boboldehampsinkcommented, Nov 18, 2021

@lmiller1990 great! By the way, there is also an open issue for this in VTU v1 that would be fixed by backporting this: https://github.com/vuejs/vue-test-utils/issues/1833

Read more comments on GitHub >

github_iconTop Results From Across the Web

mount() and shallowMount() from @vue/test-utils throw ...
The error means that mount tries to read components property of ActuatorController and fails. Components are default exports in Vue single ...
Read more >
Common Tips | Vue Test Utils
Notice that using shallowMount will make the component under testing different from the component you run in your application – some of its...
Read more >
An introduction to test-driven development with Vue.js
We mounted our ColorPicker component and wrote a test that expects to find items with a background color matching the colors passed as...
Read more >
How to set up unit testing in NativeScript Vue - Bryan Lee
The Vue way of Jest + Vue Test Utils does not work out of the box with ... Jest is the test runner...
Read more >
Vue Testing with Vue Test Utils - YouTube
In this video we will cover Vue testing with Vue Test Utils which uses Jest under the hood.Timeline:0:00 - Setup10:37 - Test Structure17:15 ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found