Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
6249bd2
feat(browser): fork jest-dom
sheremet-va Mar 4, 2025
de7fb24
chore: add more
sheremet-va Mar 4, 2025
49a7b2f
feat: support toHaveStyle/toHaveClass
sheremet-va Mar 5, 2025
8cd2e36
chore: update if empty
sheremet-va Mar 5, 2025
b3a5c87
chore: fix errors
sheremet-va Mar 5, 2025
31a2014
feat: add more
sheremet-va Mar 5, 2025
19d5bf1
chore: move expect-dom tests
sheremet-va Mar 5, 2025
60ad431
feat: more matchers
sheremet-va Mar 5, 2025
678d61e
tests: add tests
sheremet-va Mar 5, 2025
19a73b9
chore: toContainElement
sheremet-va Mar 5, 2025
535bfa1
test: toContainHTML
sheremet-va Mar 5, 2025
0ea013f
test: toHaveAccessibleDescription
sheremet-va Mar 5, 2025
f2cc409
chore: test
sheremet-va Mar 6, 2025
54ee4b8
Merge branch 'main' of github.com:vitest-dev/vitest into feat/browser…
sheremet-va Mar 7, 2025
176a160
chore: add tests and fix edge cases
sheremet-va Mar 7, 2025
1c70008
Merge branch 'main' of github.com:vitest-dev/vitest into feat/browser…
sheremet-va Mar 20, 2025
d771aeb
chore: fix build
sheremet-va Mar 20, 2025
c0cac8e
chore: update how testing-library types are referenced
sheremet-va Mar 20, 2025
4fdfc7e
chore: update tljd docs
sheremet-va Mar 20, 2025
1db3626
chore: cleanup
sheremet-va Mar 20, 2025
086fef0
chore: delete stats
sheremet-va Mar 20, 2025
3cd23fb
docs: draft docs
sheremet-va Mar 21, 2025
378fc0e
docs: add assertion docs
sheremet-va Mar 21, 2025
756a70c
chore: expect.element supports null
sheremet-va Mar 21, 2025
d5e89f6
chore: fix lint
sheremet-va Mar 24, 2025
8861852
chore: cleanup
sheremet-va Mar 25, 2025
5acf617
Merge branch 'main' of github.com:vitest-dev/vitest into feat/browser…
sheremet-va Mar 25, 2025
fb056b7
test: fix toBeDisabled test
sheremet-va Mar 25, 2025
5fa21a2
fix: run additional checks on webkit for toBeVisible assertion
sheremet-va Mar 25, 2025
fd6c417
fix: add additional checks for webkit details
sheremet-va Mar 25, 2025
b83511d
chore: remove jest-dom from dev deps
sheremet-va Mar 26, 2025
ca8442c
docs: bundle -> fork
sheremet-va Mar 26, 2025
6c18f7b
docs: update links
sheremet-va Mar 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,055 changes: 1,012 additions & 43 deletions docs/guide/browser/assertion-api.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/guide/browser/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ However, Vitest also provides packages to render components for several popular

If your framework is not represented, feel free to create your own package - it is a simple wrapper around the framework renderer and `page.elementLocator` API. We will add a link to it on this page. Make sure it has a name starting with `vitest-browser-`.

Besides rendering components and locating elements, you will also need to make assertions. Vitest bundles the [`@testing-library/jest-dom`](https://github.com/testing-library/jest-dom) library to provide a wide range of DOM assertions out of the box. Read more at the [Assertions API](/guide/browser/assertion-api).
Besides rendering components and locating elements, you will also need to make assertions. Vitest forks the [`@testing-library/jest-dom`](https://github.com/testing-library/jest-dom) library to provide a wide range of DOM assertions out of the box. Read more at the [Assertions API](/guide/browser/assertion-api).

```ts
import { expect } from 'vitest'
Expand Down
8 changes: 6 additions & 2 deletions docs/guide/browser/locators.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@ outline: [2, 3]

# Locators

A locator is a representation of an element or a number of elements. Every locator is defined by a string called a selector. Vitest abstracts this selector by providing convenient methods that generate those selectors behind the scenes.
A locator is a representation of an element or a number of elements. Every locator is defined by a string called a selector. Vitest abstracts this selector by providing convenient methods that generate them behind the scenes.

The locator API uses a fork of [Playwright's locators](https://playwright.dev/docs/api/class-locator) called [Ivya](https://npmjs.com/ivya). However, Vitest provides this API to every [provider](/guide/browser/config.html#browser-provider).
The locator API uses a fork of [Playwright's locators](https://playwright.dev/docs/api/class-locator) called [Ivya](https://npmjs.com/ivya). However, Vitest provides this API to every [provider](/guide/browser/config.html#browser-provider), not just playwright.

::: tip
This page covers API usage. To better understand locators and their usage, read [Playwright's "Locators" documentation](https://playwright.dev/docs/locators).
:::

## getByRole

Expand Down
3 changes: 2 additions & 1 deletion packages/browser/context.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { SerializedConfig } from 'vitest'
import { SerializedConfig } from 'vitest'
import { ARIARole } from './aria-role.js'
import {} from './matchers.js'

export type BufferEncoding =
| 'ascii'
Expand Down
Loading
Loading