-
-
Notifications
You must be signed in to change notification settings - Fork 162
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
Switching between Vue 2 and Vue 3 to run tests with Composition API #38
Comments
@dobromir-hristov Sorry for the delay, what's the error message the plugin throws? You can run |
Its OK I got it working, in be it a hackier way :D https://github.com/vuelidate/vuelidate/blob/next/scripts/swap-vue.js As I said the composition API imports vue from |
Glad to know you get it to work. The plugin should only import Vue before installing, it should work for custom Vue instance (where vue demi feed it to) after the installations. 🤔 |
Just had the same issue as @dobromir-hristov, but on my end was related to I'm trying make a simple library isomorphic, and the default version is vue 2. I've aliased The problem was also that |
This is "almost" an "integration" test, to ensure the code works on actual vue environment. Add plugin instalation tests. SIDE-EFFECTS: - shoutout to the Dobromir for the code vueuse/vue-demi#38 (comment) - forward correct test utils exports - add ifVue2 and ifVue3 test utils, when testing breaking changes — code that is not inter-compatible - add universalDestroy, because lifecycle hook names changed and this prevents the version check on test code
This is "almost" an "integration" test, to ensure the code works on actual vue environment. Add plugin instalation tests. SIDE-EFFECTS: - shoutout to the Dobromir for the code vueuse/vue-demi#38 (comment) - forward correct test utils exports - add ifVue2 and ifVue3 test utils, when testing breaking changes — code that is not inter-compatible - add universalDestroy, because lifecycle hook names changed and this prevents the version check on test code
This is "almost" an "integration" test, to ensure the code works on actual vue environment. Add plugin instalation tests. SIDE-EFFECTS: - shoutout to the Dobromir for the code vueuse/vue-demi#38 (comment) - forward correct test utils exports - add ifVue2 and ifVue3 test utils, when testing breaking changes — code that is not inter-compatible - add universalDestroy, because lifecycle hook names changed and this prevents the version check on test code
This is "almost" an "integration" test, to ensure the code works on actual vue environment. Add plugin instalation tests. SIDE-EFFECTS: - shoutout to the Dobromir for the code vueuse/vue-demi#38 (comment) - forward correct test utils exports - add ifVue2 and ifVue3 test utils, when testing breaking changes — code that is not inter-compatible - add universalDestroy, because lifecycle hook names changed and this prevents the version check on test code
Summary
I tried using
vue-demi-switch 2 vue2
and defining"vue2": "npm:vue@2"
in my package.json, but when I run tests, the@vue/composition-api
breaks, because it imports Vue asvar Vue = require('vue');
Do you have any advice on how to proceed with this? I saw
vueuse/core
uses this approach but I couldnt see if you have a fix for this.You can see this in https://github.com/vuelidate/vuelidate/tree/next
The text was updated successfully, but these errors were encountered: