Skip to main content

Vitest

Recommendation
Updated
Moved
USE
2022-04-06

What is it

Vitest is a unit-test framework powered by Vite. Is uses a syntax very similar to Jest, but is faster. Jest is configured with a separate set of transforms, which is redundant in most cases and gives additional setup to maintain.

When to use it

Use Vitest to write unit tests for your code. It should not test the user flows of your applications. It may be used to test isolated and specific user interactions, such as pressing a button to display another HTML element. Your application should always contain unit tests to test your business logic. It should be combined with react-testing-library for React applications.

How to learn it

Learn Vitest in the official documentation.

Known issues

Currently vitest is not supported as a test framework by Goland.

There are known issues when trying to update snapshot running vitest in watch mode.