You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/config/index.md
-95Lines changed: 0 additions & 95 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -593,101 +593,6 @@ jsdom environment exposes `jsdom` global variable equal to the current [JSDOM](h
593
593
594
594
These options are passed down to `setup` method of current [`environment`](#environment). By default, you can configure only JSDOM options, if you are using it as your test environment.
595
595
596
-
### environmentMatchGlobs
597
-
598
-
-**Type:**`[string, EnvironmentName][]`
599
-
-**Default:**`[]`
600
-
601
-
::: danger DEPRECATED
602
-
This API was deprecated in Vitest 3. Use [projects](/guide/projects) to define different configurations instead.
603
-
604
-
```ts
605
-
exportdefaultdefineConfig({
606
-
test: {
607
-
environmentMatchGlobs: [ // [!code --]
608
-
['./*.jsdom.test.ts', 'jsdom'], // [!code --]
609
-
], // [!code --]
610
-
projects: [ // [!code ++]
611
-
{ // [!code ++]
612
-
extends: true, // [!code ++]
613
-
test: { // [!code ++]
614
-
environment: 'jsdom', // [!code ++]
615
-
}, // [!code ++]
616
-
}, // [!code ++]
617
-
], // [!code ++]
618
-
},
619
-
})
620
-
```
621
-
:::
622
-
623
-
Automatically assign environment based on globs. The first match will be used.
624
-
625
-
For example:
626
-
627
-
```ts
628
-
import { defineConfig } from'vitest/config'
629
-
630
-
exportdefaultdefineConfig({
631
-
test: {
632
-
environmentMatchGlobs: [
633
-
// all tests in tests/dom will run in jsdom
634
-
['tests/dom/**', 'jsdom'],
635
-
// all tests in tests/ with .edge.test.ts will run in edge-runtime
Copy file name to clipboardExpand all lines: docs/guide/environment.md
-2Lines changed: 0 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,8 +39,6 @@ test('test', () => {
39
39
})
40
40
```
41
41
42
-
Or you can also set [`environmentMatchGlobs`](https://vitest.dev/config/#environmentmatchglobs) option specifying the environment based on the glob patterns.
43
-
44
42
## Custom Environment
45
43
46
44
You can create your own package to extend Vitest environment. To do so, create package with the name `vitest-environment-${name}` or specify a path to a valid JS/TS file. That package should export an object with the shape of `Environment`:
'Since Vitest 0.31.0 "browser" pool is not supported in `poolMatchGlobs`. You can create a project to run some of your tests in browser in parallel. Read more: https://vitest.dev/guide/projects',
0 commit comments