[READ-ONLY] Mirror of https://github.com/vitest-dev/vitest. Next generation testing framework powered by Vite. vitest.dev
test testing-tools vite
vitest docs guide browser assertion-api.md
3.1 kB · 65 lines


title: Assertion API | Browser Mode #

Assertion API #

Vitest bundles @testing-library/jest-dom library to provide a wide range of DOM assertions out of the box. For detailed documentation, you can read the jest-dom readme:

If you are using TypeScript or want to have correct type hints in expect, make sure you have either @vitest/browser/providers/playwright or @vitest/browser/providers/webdriverio specified in your tsconfig depending on the provider you use. If you use the default preview provider, you can specify @vitest/browser/matchers instead.

::: code-group

{
  "compilerOptions": {
    "types": [
      "@vitest/browser/matchers"
    ]
  }
}
{
  "compilerOptions": {
    "types": [
      "@vitest/browser/providers/playwright"
    ]
  }
}
{
  "compilerOptions": {
    "types": [
      "@vitest/browser/providers/webdriverio"
    ]
  }
}

:::