Skip to content

Commit

Permalink
feat(browser): introduce expect.dom method and bundle jest-dom ma…
Browse files Browse the repository at this point in the history
…tchers with `@vitest/browser` (#5910)
  • Loading branch information
sheremet-va authored Jun 20, 2024
1 parent 51c04e2 commit 3a96a3d
Show file tree
Hide file tree
Showing 16 changed files with 1,284 additions and 95 deletions.
4 changes: 4 additions & 0 deletions docs/config/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,10 @@ browser-like environment through either [`jsdom`](https://github.com/jsdom/jsdom
or [`happy-dom`](https://github.com/capricorn86/happy-dom) instead.
If you are building edge functions, you can use [`edge-runtime`](https://edge-runtime.vercel.app/packages/vm) environment

::: tip
You can also use [Browser Mode](/guide/browser) to run integration or unit tests in the browser without mocking the environment.
:::

By adding a `@vitest-environment` docblock or comment at the top of the file,
you can specify another environment to be used for all tests in that file:

Expand Down
449 changes: 359 additions & 90 deletions docs/guide/browser.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export default antfu(
'**/bench.json',
'**/fixtures',
'**/assets/**',
'**/*.d.ts',
'**/*.timestamp-*',
'test/core/src/self',
'test/cache/cache/.vitest-base/results.json',
Expand Down
Loading

0 comments on commit 3a96a3d

Please sign in to comment.