Component can't access `$props` in template when using `mountSuspended` from test utils
Hello all!
I've been going through and adding testing into my Nuxt3 project as I prepare for an official release. I currently have a component that looks like this:
And my unit test looks like this:
I have a minimal vitest setup with:
Every time this test runs, I get an error saying that I
Additionally, using just
cannot read category_label of undefined
.
If I declare props in the setup block, with const myProps = defineProps<...>
and then update the template, the test runs fine.Additionally, using just
mount
directly from @vue/test-utils
also works with $props
without any issue
Have I simply been setting up all my template props wrong? Or is there something I'm missing with the nuxt testing setup? I followed the basic steps outline in the testing docs, but I can't seem to find anything I've missed. Any help would be greatly appreciate!0 Replies