Test failed for parent component with error 'TypeError: Illegal invocation'
mr-yogesh-galav opened this issue · 2 comments
We are using vue-avatar-cropper inside Parent component(ProfilePic) for which test suit is getting failed.
we are using jest to test vue components.
ProfilePic.spec.js->
import { shallowMount } from '@vue/test-utils';
import ProfilePic from '../../../resources/js/components/ProfilePic';
import AvatarCropper from 'vue-avatar-cropper';
describe('ProfilePic.vue', () => {
//not test has been added
});
when running 'npm run test -- ProfilePic' the error logs are -
TypeError: Illegal invocation
at Window.addEventListener (node_modules/jsdom/lib/jsdom/living/generated/EventTarget.js:99:15)
at node_modules/vue-avatar-cropper/dist/index.js:2:10187
at node_modules/vue-avatar-cropper/dist/index.js:2:10047
at Object.call (node_modules/vue-avatar-cropper/dist/index.js:2:4861)
at n (node_modules/vue-avatar-cropper/dist/index.js:2:358)
at Module.call (node_modules/vue-avatar-cropper/dist/index.js:2:58880)
at n (node_modules/vue-avatar-cropper/dist/index.js:2:358)
at Object.call (node_modules/vue-avatar-cropper/dist/index.js:2:42233)
at n (node_modules/vue-avatar-cropper/dist/index.js:2:358)
at node_modules/vue-avatar-cropper/dist/index.js:2:1158
Can you update to 3.0.6
and check if this still happens? I removed the vanilla JS event listeners.
Closing this due to inactivity.