Skip to content

Commit 12762ea

Browse files
authored
perf(browser): fork jest-dom instead of bundling it (#7605)
1 parent 2a8520a commit 12762ea

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+7710
-851
lines changed

docs/guide/browser/assertion-api.md

+1,012-43
Large diffs are not rendered by default.

docs/guide/browser/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ However, Vitest also provides packages to render components for several popular
401401

402402
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-`.
403403

404-
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).
404+
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).
405405

406406
```ts
407407
import { expect } from 'vitest'

docs/guide/browser/locators.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@ outline: [2, 3]
55

66
# Locators
77

8-
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.
8+
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.
99

10-
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).
10+
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.
11+
12+
::: tip
13+
This page covers API usage. To better understand locators and their usage, read [Playwright's "Locators" documentation](https://playwright.dev/docs/locators).
14+
:::
1115

1216
## getByRole
1317

packages/browser/context.d.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import type { SerializedConfig } from 'vitest'
1+
import { SerializedConfig } from 'vitest'
22
import { ARIARole } from './aria-role.js'
3+
import {} from './matchers.js'
34

45
export type BufferEncoding =
56
| 'ascii'

0 commit comments

Comments
 (0)