cypress/vue: mount is not a function (component testing) #22526
-
I am currently trying to integrate cypress in an existing vue2 application. I followed the guides to install cypress but I end up getting this error in my component tests
Now I have been able to narrow it down to this line in the components.ts support file
I was able to add other custom functions without any problems. Also if I remove this line my tests don't crash. If I import mount directly in the test I end up with the same error again. Now I am not running into this problem when I set up a new project from scratch and I checked basically everything for differences but did not find any. I'd be happy to provide more info but am not sure where to look. Here's the current info about the versions: node: 16.15.1 https://stackoverflow.com/questions/68627950/error-in-cypress-object-is-not-a-function This user seems to have the same problem. Unfortunately there are no responses yet. Would be great if someone had an idea what I am missing. Happy to provide more information |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
@relief-melone Are you using the A simple test should look like: import MyComponent from './MyComponent.vue'
import { mount } from 'cypress/vue2'
it('should render', () => {
mount(MyComponent)
}) |
Beta Was this translation helpful? Give feedback.
@relief-melone Are you using the
cypress/vue2
import?A simple test should look like: