5

We want to use vue composition api using the script setup in our company. How would one write unit tests for a script setup component?

We're using Vue 2.7.14 and vitest if that matters.

3
  • Isn’t it possible to use Vue Test Utils? There is some information about the @vue/test-utils in the vue 2.7 announcement Commented Feb 24, 2023 at 21:55
  • >Note: if you are using @vue/test-utils, you will need to keep vue-template-compiler in the dependencies because test utils rely on some APIs only exposed in this package. Commented Feb 24, 2023 at 21:55
  • It's amazing how no one has replied to this for over a year. This is a very valid question for our project. Commented Apr 24, 2024 at 8:40

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.