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: website/docs/en/config/test/projects.mdx
+51-3Lines changed: 51 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,19 @@
1
1
# projects
2
2
3
-
-**Type:**`string[]`
3
+
-**Type:**
4
+
5
+
```ts
6
+
typeProjectConfig=Omit<
7
+
RstestConfig,
8
+
'projects'|'reporters'|'pool'|'isolate'
9
+
>;
10
+
11
+
typeProjects= (string|ProjectConfig)[];
12
+
```
13
+
4
14
-**Default:**`[<rootDir>]`
5
15
6
-
An array of directories, config files, or glob patterns that define multiple test projects.
16
+
An array of directories, config files, or glob patterns, or an object to define multiple test projects.
7
17
8
18
`rstest` will run the tests for each project according to the configuration defined in each project, and the test results from all projects will be combined and displayed.
It should be noted that project configuration does not inherit root configuration. If there is shared configuration between your sub-projects, you can extract the shared configuration and import it in the sub-project:
55
+
## Configuration notes
56
+
57
+
- Project configuration does not inherit root configuration. If there is shared configuration between your sub-projects, you can extract the shared configuration and import it in the sub-project.
58
+
- Some root-level options such as `reporters`, `pool`, and `isolate` are not valid in a project configuration.
59
+
-`projects` does not support nesting.
35
60
36
61
```ts title='packages/pkg-a/rstest.config.ts'
37
62
import { defineConfig } from'@rstest/core';
@@ -41,3 +66,26 @@ export default defineConfig({
41
66
...sharedConfig,
42
67
});
43
68
```
69
+
70
+
## Inline configuration
71
+
72
+
`rstest` supports configuring projects inline in the `projects` field. This lets you define multiple test projects in a single root without creating separate config files for each test project.
0 commit comments