Replies: 1 comment
-
Hi @Restage I'm not familiar with PrimeVue3, but is it a Vite plugin? I think it is a Vue plugin (hence why you use What I thin is that you do need to add it to your mount options. See https://test-utils.vuejs.org/api/#global Something like: mount(ServerDialog, {
global: {
plugins: [PrimeVue]
}
} and if you're using alias, you probably need to define them to: mount(ServerDialog, {
global: {
plugins: [PrimeVue],
components: {
pvDialog: Dialog,
pvInputText: inputText
}
}
} If that does not work, can you provide us a small repro online using https://stackblitz.com/fork/github/vitest-dev/vitest/tree/main/examples/vue?initialPath=__vitest__ ? With a repro we can more easily help you. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone,
I've written a Vue3 application, which uses PrimeVue3 as component library. Now I would like to write tests for my graphical user interface. But I can not get Vitest and Vue-Utils to render the PrimeVue3 components within the test. All I see is the plain
<template>
code. My project has the following setup:Of course this config was shortend by me to the entries I think are relevant for my question.
My
vitest.config.js
includes Vue and PrimeVue3 as plugins.In my test I do the following:
The test fails looking for a definitly existing id from my component. In the logged html I see none rendered code like this:
What am I missing as a dependency or configuration?
One further advice: I added the PrimeVue3 Dialog and InputText components with an alias. That is why they are shown as
<pvdialog>
and<pvinputtext>
. I have also tried to use default names, but this did not change the behaviour.Best regards,
Richard
Beta Was this translation helpful? Give feedback.
All reactions