It doesn't work currently, because isVueInstance property was already deprecated in @vue/test-utils@1 and as such it does not exist in v2 which is mandatory for vue3 app. That property is used to assert if the input is a @vue/test-utils wrapper. The fix was to replace it with html function check, since we actually call it a few lines bellow.
const isVueWrapper = received => (
received &&
typeof received === 'object' &&
- typeof received.isVueInstance === 'function'
+ typeof received.html === 'function'
I could have included vue3 assertions, but the only way I could setup this project was by using node@8 which is too far behind to allow installation of vue3 which requires the minimum node version to be 10
Making tests isomorphic (run through both vue2 and vue3) requires a bit of work and would also require me to fix the node version issues (which I don't have the time ATM). Usually we go with vue-demi or use the vuelidate strategy — a swap-vue.js script combined with aliased version packages.
This repo was in a dirty state with an unpublished breaking change, so I've released this fix in a new major version—v3.0.0 (v3.1.0 is equivalent, whoops).
As described on https://github.com/eddyerburgh/jest-serializer-vue/issues/49#issuecomment-1316950926, closes https://github.com/eddyerburgh/jest-serializer-vue/issues/49
It doesn't work currently, because
isVueInstance
property was already deprecated in@vue/test-utils@1
and as such it does not exist in v2 which is mandatory for vue3 app. That property is used to assert if the input is a@vue/test-utils
wrapper. The fix was to replace it withhtml
function check, since we actually call it a few lines bellow.https://github.com/eddyerburgh/jest-serializer-vue/blob/600b2c0e68e4a15c113d22beb10d706947e7409a/index.js#L4-L7
Notes
node@8
which is too far behind to allow installation of vue3 which requires the minimum node version to be10
vue-demi
or use thevuelidate
strategy — a swap-vue.js script combined with aliased version packages.