Skip to main content

Testing JavaScript

Jest

Vitest

  • Fast Unit Testing With Vitest • Anthony Fu & Jason Lengstorf explain the differences between Vitest and Jest, then demonstrate how to install and configure Vitest and use it to write unit tests (including snapshot tests) • Learn with Jason 📺
    • ESM is async by default, while CommonJS is sync by default
      • When you require a CJS module, you can’t be sure that it’s ready to use
      • This makes it hard to use Jest (which uses CJS) with Vite (which uses ESM)

Mocking API responses

Playwright

See testing (since it can be used in multiple languages).

Cypress

E2E tests vs unit tests

Inbox