QuasarJS: Setup Testing with Vitest

#1. Install Quasar. Choose Vite as the development server.

yarn create quasar

#2. Install Vitest using Quasar Application Extension (AE).

yarn quasar ext add @quasar/testing

#3. Choose Vitest.

#4. Select necessary options:

  • Extra “scripts” in your package.json: So that you can run the test with npm test or yarn test.
  • Use Typescript: Example test and vitest.config will be in Typescript.
  • Install Vitest UI: Install @vitest@ui

#5. Run Vitest (The AE provides test examples that you can run with).

quasar test --unit vitest

Or, if you choose to add the Extra “scripts” you can use bellow command.

yarn test:unit

References:


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *