Skip to content

Commit 318ae17

Browse files
committed
docs: add browser compatibility table to browser mode
Closes #5347
1 parent 021075b commit 318ae17

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

docs/guide/browser.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,17 @@ title: Browser Mode | Guide
66

77
This page provides information about the experimental browser mode feature in the Vitest API, which allows you to run your tests in the browser natively, providing access to browser globals like window and document. This feature is currently under development, and APIs may change in the future.
88

9+
## Browser Compatibility
10+
11+
Vitest uses [Vite dev server](https://vitejs.dev/guide/#browser-support) to run your tests, so we only support features specified in the [`esbuild.target`](https://vitejs.dev/config/shared-options.html#esbuild) option (`esnext` by default).
12+
13+
By default, Vite targets browsers which support the native [ES Modules](https://caniuse.com/es6-module), native [ESM dynamic import](https://caniuse.com/es6-module-dynamic-import), and [`import.meta`](https://caniuse.com/mdn-javascript_operators_import_meta). On top of that, we utilize [`BroadcastChannel`](https://caniuse.com/?search=BroadcastChannel) to communicate between iframes:
14+
15+
- Chrome >=87
16+
- Firefox >=78
17+
- Safari >=15.4
18+
- Edge >=88
19+
920
## Motivation
1021

1122
We developed the Vitest browser mode feature to help improve testing workflows and achieve more accurate and reliable test results. This experimental addition to our testing API allows developers to run tests in a native browser environment. In this section, we'll explore the motivations behind this feature and its benefits for testing.

0 commit comments

Comments
 (0)