Fast unit and integration tests for dependable code.
Jest and Vitest are test runners for unit and integration tests in JavaScript and TypeScript. Vitest shares its config and transform setup with Vite, runs lightning fast in watch mode and understands TypeScript, ESM and path aliases with no extra effort. Jest is the proven classic with an enormous ecosystem, very mature mocking and snapshot support. Both secure the small but important building blocks of an application, so larger changes never quietly break something.
More in the documentationIn every project with its own logic we write the critical functions so they check themselves. On Vite- or Vitest-adjacent stacks we reach for Vitest, because you save a second config and the tests run at the same pace as your dev server. That keeps refactors fear-free and gives you a clear yes or no on every commit.
import { describe, it, expect } from "vitest";
import { slugify } from "./slugify";
describe("slugify", () => {
it("lowercases and dashes spaces", () => {
expect(slugify("Hello World")).toBe("hello-world");
});
});Good to know
Vitest speaks almost the same API as Jest, so a migration is often just a swap of the import. Watch out for mocking though: Vitest uses vi instead of jest and hoists vi.mock just like Jest, so the mock factory must not reference outer variables.
More tools we work with in the same area.
Testing Library
User-centred component tests that check real behaviour.
Playwright
End-to-end tests that secure real user flows in the browser.
Cypress
Convenient E2E testing with excellent debugging.
Sentry
Realtime error tracking and performance monitoring in production.
ESLint & Prettier
Automatic code quality and consistent formatting.
You don't have to decide that, it's our job. Tell us about your plans.