Webstorm unable to detect component methods in test files.
I am using WebStorm for the first time and I have a vue project that is already well written. When we open the test cases, WebStorm does not identify the component methods when they are called by mount or shallowMount using wrapper.vm. For example, if I have wrapper.vm.method() then the error I am getting is Unresolved function or method.
Any help in resolving this issue is much appreciated.
Thanks
Please sign in to leave a comment.
This would require adding special support for wrapper.vm, as the methods are added dynamically in runtime and thus can't be resolved statically
But, for me, methods/data props are resolved (though not suggested by completion - https://youtrack.jetbrains.com/issue/WEB-51228):
I am getting the same issue, no autocompletion and `method does not exist on type Vue` errors. Right tab in the image is TransferDateConfig.vue
Jonathan Mackenzie your issue is a bit different. The error comes from the Typescript compiler. Please see https://github.com/vuejs/vue-test-utils/issues/255#issuecomment-363014085 for explanation. See also https://stackoverflow.com/questions/54256546/testing-vuejs-and-typescript-with-jest-causes-an-error-property-xxx-does-not