vitest/docs/guide/browser/assertion-api.md
Joaquín Sánchez 50130bdb59
docs: split browser page (#5988)
Co-authored-by: Vladimir <sleuths.slews0s@icloud.com>
2024-07-01 13:51:59 +02:00

3.0 KiB

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"
    ]
  }
}

:::