Skip to main content

19. Vitest is our test framework for javascript

Date: 2025-04-19

Status

Accepted

Context

We tried to go back to Jest but it ran into problems with nanoid and date-fns. Both libraries are modern and well manintained, so it seemed like the problem was with Jest. Several different people recommended vitest since it doesnt' have these problems and it is very fast. We were not able to use vite on the plasmo app so we weren't sure if it would work on its own. We asked the AI to migrate the existing Jest (which mostly worked) over to vitetst. Once we corrected a setting int he package.json it ran smoothely.

Decision

We will use vitest as our testing framework for all javascript projects even if they don't use Vite.

Consequences

Tests are fast and we didn't have to do a lot of weird configuration to get third party libraries to work.