rich-bear-48716
06/15/2022, 11:55 AMpowerful-translator-20726
06/16/2022, 11:04 PMATest.vue
ts
<template>
<div class="test">{{ $props.msg }}</div>
<div>Count: {{ count }}</div>
<button @click="count++">Click me</button>
</template>
<script lang="ts" setup>
import { ref } from 'vue'
defineProps({
msg: {
type: String,
default: 'Test',
},
})
const count = ref(0)
</script>
<style scoped>
.text {
color: red;
}
</style>
this is my testfile:
ATest.cy.ts
ts
import ATest from './ATest.vue'
describe('ATest.vue', () => {
it('should mount', () => {
cy.mount(ATest, {
props: {
msg: '324'
}
});
cy.get('div')
});
});
anyone any idea? or had the same issue?breezy-australia-64868
06/17/2022, 3:17 PMmagnificent-finland-58048
06/17/2022, 8:01 PMlimited-room-30929
06/18/2022, 6:27 AMchilly-honey-38565
06/20/2022, 5:28 PMlimited-room-30929
06/21/2022, 7:38 AMmodelValue
limited-room-30929
06/21/2022, 7:38 AMchilly-honey-38565
06/21/2022, 12:48 PMglobal: {
mocks: {
listData: listData
}
},
many-fountain-92674
06/23/2022, 2:33 PM@cypress/vue
?
when using @vue/test-utils
directly it could be achieved as such, for example:
import { config } from '@vue/test-utils'
config.global.plugins.unshift([SomePlugin])
but that doesn't seem possible with @cypress/vue
I can, of course, use:
mount(Foo, { global: { plugins: [SomePlugin] } })
But the plugin is required for every test, so it's a bit convoluted to do it everytime.
I worked around it by always injecting the required plugin in my cy.mount
, which works fine, but won't work when importing the mount
directly, of course.many-fountain-92674
06/24/2022, 10:42 AMmelodic-sandwich-17161
06/29/2022, 6:46 AMmagnificent-finland-58048
06/30/2022, 10:49 AMmelodic-sandwich-17161
06/30/2022, 5:44 PMstocky-dream-36427
07/03/2022, 12:20 AMstocky-dream-36427
07/03/2022, 12:20 AMcypress/vue2
instead of cypress/vue
victorious-engine-31076
07/12/2022, 9:16 AMwonderful-match-15836
07/12/2022, 3:12 PMvictorious-engine-31076
07/12/2022, 3:42 PMwonderful-match-15836
07/14/2022, 1:52 PMquick-student-52343
07/16/2022, 11:42 AMpowerful-translator-20726
07/16/2022, 12:04 PMts
devServer: {
viteConfig: {
server: {
https: false,
},
},
framework: 'vue',
bundler: 'vite',
},
quick-student-52343
07/16/2022, 12:35 PMhigh-shampoo-86680
07/20/2022, 9:55 PMhigh-shampoo-86680
07/20/2022, 9:56 PMbest-flower-17510
07/21/2022, 3:55 PMhigh-shampoo-86680
07/29/2022, 5:38 PMcypress-vue2.esm-bundler.js
vs cypress-vue.esm-bundler.js
? I ask because my component tests are calling the second one, even though ours is a Vue2 project. There were some errors getting thrown around unmount
that I fixed with some duct tape during our custom mount function because of this. But yeah, I can't seem to find anywhere in the docs where one specifies which esm-bundler to usefull-wall-14294
08/05/2022, 9:27 PMlimited-room-30929
08/07/2022, 9:53 AMgifted-summer-12568
08/07/2022, 3:34 PM