Skip to content

Usage of vitest

Status

Accepted.

Context

The previous Vue 2 codebase used jest for unit and component tests, which required additional transformers and configuration to work with TypeScript and single-file components.

The rewrite introduced by ADR 0009 is built with vite, so the test runner should fit that toolchain.

Decision

We use vitest as test runner.

Consequences

  • (+) The vite configuration, including aliases and plugins, is reused for tests, so there is no second build setup to maintain.
  • (+) No additional transformers are needed for TypeScript and single-file components.
  • (+) Features such as in-source testing become available.
  • (o) Tests written for jest have to be migrated, although the API is largely compatible.