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
- Workers multi-threading via [Tinypool](https://github.com/tinylibs/tinypool) (a lightweight fork of [Piscina](https://github.com/piscinajs/piscina))
45
45
- Benchmarking support with [Tinybench](https://github.com/tinylibs/tinybench)
46
-
-[Workspace](https://vitest.dev/guide/workspace) support
46
+
-[Projects](https://vitest.dev/guide/projects) support
47
47
-[expect-type](https://github.com/mmkal/expect-type) for type-level testing
Copy file name to clipboardExpand all lines: docs/.vitepress/components/FeaturesList.vue
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@
13
13
<ListItem>Workers multi-threading via <atarget="_blank"href="https://github.com/tinylibs/tinypool"rel="noopener noreferrer">Tinypool</a></ListItem>
14
14
<ListItem>Benchmarking support with <atarget="_blank"href="https://github.com/tinylibs/tinybench"rel="noopener noreferrer">Tinybench</a></ListItem>
15
15
<ListItem>Filtering, timeouts, concurrent for suite and tests</ListItem>
Copy file name to clipboardExpand all lines: docs/advanced/api/plugin.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,7 +53,7 @@ Vitest re-exports all Vite type-only imports via a `Vite` namespace, which you c
53
53
```
54
54
:::
55
55
56
-
Unlike [`reporter.onInit`](/advanced/api/reporters#oninit), this hooks runs early in Vitest lifecycle allowing you to make changes to configuration like `coverage` and `reporters`. A more notable change is that you can manipulate the global config from a [workspace project](/guide/workspace) if your plugin is defined in the project and not in the global config.
56
+
Unlike [`reporter.onInit`](/advanced/api/reporters#oninit), this hooks runs early in Vitest lifecycle allowing you to make changes to configuration like `coverage` and `reporters`. A more notable change is that you can manipulate the global config from a [test project](/guide/projects) if your plugin is defined in the project and not in the global config.
Copy file name to clipboardExpand all lines: docs/advanced/api/vitest.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -64,7 +64,7 @@ Benchmark mode calls `bench` functions and throws an error, when it encounters `
64
64
65
65
## config
66
66
67
-
The root (or global) config. If workspace feature is enabled, projects will reference this as `globalConfig`.
67
+
The root (or global) config. If projects are defined, they will reference this as `globalConfig`.
68
68
69
69
::: warning
70
70
This is Vitest config, it doesn't extend _Vite_ config. It only has resolved values from the `test` property.
@@ -101,17 +101,17 @@ Cache manager that stores information about latest test results and test file st
101
101
102
102
## projects
103
103
104
-
An array of [test projects](/advanced/api/test-project) that belong to the user's workspace. If the user did not specify a custom workspace, the workspace will only have a [root project](#getrootproject).
104
+
An array of [test projects](/advanced/api/test-project) that belong to user's projects. If the user did not specify a them, this array will only contain a [root project](#getrootproject).
105
105
106
-
Vitest will ensure that there is always at least one project in the workspace. If the user specifies a non-existent `--project` name, Vitest will throw an error.
106
+
Vitest will ensure that there is always at least one project in this array. If the user specifies a non-existent `--project` name, Vitest will throw an error before this array is defined.
107
107
108
108
## getRootProject
109
109
110
110
```ts
111
111
function getRootProject():TestProject
112
112
```
113
113
114
-
Thisreturnstheroottestproject. Therootprojectgenerallydoesn't run any tests and is not included in `vitest.projects` unless the user explicitly includes the root config in their workspace, or the workspace is not defined at all.
114
+
Thisreturnstheroottestproject. Therootprojectgenerallydoesn't run any tests and is not included in `vitest.projects` unless the user explicitly includes the root config in their configuration, or projects are not defined at all.
Copy file name to clipboardExpand all lines: docs/advanced/pool.md
+3-7Lines changed: 3 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,12 +31,12 @@ export default defineConfig({
31
31
})
32
32
```
33
33
34
-
If you need to run tests in different pools, use the [workspace](/guide/workspace) feature:
34
+
If you need to run tests in different pools, use the [`projects`](/guide/projects) feature:
35
35
36
36
```ts [vitest.config.ts]
37
37
exportdefaultdefineConfig({
38
38
test: {
39
-
workspace: [
39
+
projects: [
40
40
{
41
41
extends: true,
42
42
test: {
@@ -48,10 +48,6 @@ export default defineConfig({
48
48
})
49
49
```
50
50
51
-
::: info
52
-
The `workspace` field was introduced in Vitest 3. To define a workspace in [Vitest 2](https://v2.vitest.dev/), create a separate `vitest.workspace.ts` file.
53
-
:::
54
-
55
51
## API
56
52
57
53
The file specified in `pool` option should export a function (can be async) that accepts `Vitest` interface as its first option. This function needs to return an object matching `ProcessPool` interface:
@@ -69,7 +65,7 @@ export interface ProcessPool {
69
65
70
66
The function is called only once (unless the server config was updated), and it's generally a good idea to initialize everything you need for tests inside that function and reuse it when `runTests` is called.
71
67
72
-
Vitest calls `runTest` when new tests are scheduled to run. It will not call it if `files` is empty. The first argument is an array of [TestSpecifications](/advanced/api/test-specification). Files are sorted using [`sequencer`](/config/#sequence-sequencer) before `runTests` is called. It's possible (but unlikely) to have the same file twice, but it will always have a different project - this is implemented via [`vitest.workspace.ts`](/guide/workspace) configuration.
68
+
Vitest calls `runTest` when new tests are scheduled to run. It will not call it if `files` is empty. The first argument is an array of [TestSpecifications](/advanced/api/test-specification). Files are sorted using [`sequencer`](/config/#sequence-sequencer) before `runTests` is called. It's possible (but unlikely) to have the same file twice, but it will always have a different project - this is implemented via [`projects`](/guide/projects) configuration.
73
69
74
70
Vitest will wait until `runTests` is executed before finishing a run (i.e., it will emit [`onFinished`](/advanced/reporters) only after `runTests` is resolved).
Copy file name to clipboardExpand all lines: docs/blog/vitest-3.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -72,7 +72,7 @@ You can follow the design process in [#7069](https://github.com/vitest-dev/vites
72
72
73
73
## Inline Workspace
74
74
75
-
Rejoice! No more separate files to define your [workspace](/guide/workspace) - specify an array of projects using the `workspace` field in your `vitest.config` file:
75
+
Rejoice! No more separate files to define your [workspace](/guide/projects) - specify an array of projects using the `workspace` field in your `vitest.config` file:
0 commit comments