Testing of Vue Components with Nuxt Auto-Import #1565
-
I'm looking for a way to unit-test components defined in nuxt3's I've managed to pipe in with nuxt : vitest, vue-test-utils and nuxt-test-utils-edge with this
I thought the setup function nuxt-test-utils-edge would help but unfortunately it's not enough to make the auto-import sweetness going in the the vitest test runner. I'm pretty new to front end engineering but I'd love to contribute on making this happen if there's not a trivial way to do so |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
You can try this https://github.com/antfu/unplugin-auto-import |
Beta Was this translation helpful? Give feedback.
-
So I managed to make it work with
Below is the
You can find an example of how everything is wired together here : https://github.com/remiconnesson/vitest-nuxt |
Beta Was this translation helpful? Give feedback.
So I managed to make it work with
unplugin-auto-import
to auto import vue stuff likeref
andcomputed
unplugin-vue-components
to auto import vue componentsBelow is the
vitest.config.js
file that gave me good results with vitestYou can find an ex…