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.

[Feature Request] Avoid importing globally Vuetify in all tests

See original GitHub issue

Versions and Environment

Vuetify: ^1.1.11 Vue: 2.5.16 Browsers: all OS: all

Previously worked in:

Vuetify: ^1.1.10 Vue: 2.5.16

Steps to reproduce

Since Vuetify version 1.1.11, developers have to import globally Vuetify in all tests to avoid having 2 multiples Vue instances running (and see a warning referring to #4068 )

localVue.use(Vuetify)

has been replaced by

Vue.use(Vuetify)

Expected Behavior

Using localVue is better because it prevents polluting the original Vue copy during tests. I expect Vuetify not to use its own instance of Vue. So I can come back using only localVue.use(Vuetify) in all of my tests

Actual Behavior

I had to use Vue.use(Vuetify) in each of my test files

Reproduction Link

https://codesandbox.io/s/mz86zx5vnj

Watch the warnings generated by the test

Additional Comments:

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:60
  • Comments:26 (7 by maintainers)

github_iconTop GitHub Comments

31reactions
stas-khcommented, Mar 6, 2019

This is super confusing, guys. Any updates here?

21reactions
johnleidercommented, Jun 10, 2019

An update on this issue. Currently with how we must extend the Vue object in order to have proper typescript support, you will have to bootstrap Vue in your test setup file:

// tests/setup.js

import Vue from 'vue'
import Vuetify from 'vuetify'

Vue.use(Vuetify)

I have dropped the ball on providing clear documentation on how to do this and for that I apologize. This is something that I will be adding to the documentation in the coming weeks for the next version.

In regards to a long term solution, I’m accepting any and all suggestions on how to accommodate typescript support while also enabling the bootstrapping of localVue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Get started with Vuetify
Get started with Vuetify, the world's most popular Vue.js framework for building feature rich, blazing fast applications. # Vue CLI Install. For ...
Read more >
Accessing properties globally in Vue.js with prototypes
You will notice that for every component from which you want to make a get request, you will have to repeat this import...
Read more >
Using custom theming in Vuetify and pass color variables to ...
There is a Feature Request on github: Access theme colors in stylus files ... Import the Vuetify styles somewhere global @import ...
Read more >
Testing Vue Components With Cypress - CSS-Tricks
Once component testing arrived in Cypress, my team was all in ... and we needed to get Vuetify and some global styles happening...
Read more >
Configuration Reference | Vue CLI
Global CLI Config #. Some global configurations for @vue/cli , such as your preferred package manager and your locally saved presets, are stored ......
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