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
A list of glob patterns that match your test files.
7
+
A list of glob patterns that match your test files. These patterns will be resolved relative to the [root](/config/test/root) (`process.cwd()` by default).
8
8
9
9
import { Tab, Tabs } from'@theme';
10
10
@@ -24,3 +24,43 @@ export default defineConfig({
24
24
```
25
25
</Tab>
26
26
</Tabs>
27
+
28
+
You can run `npx rstest list --filesOnly` to see the list of test files that Rstest will include.
29
+
30
+
```bash
31
+
$ npx rstest list --filesOnly
32
+
33
+
# the output is shown below:
34
+
a.test.ts
35
+
b.test.ts
36
+
```
37
+
38
+
## Default behavior
39
+
40
+
By default, Rstest will include all javascript / typescript files with `.test.` or `.spec.` suffix in the filename.
41
+
42
+
The following is a visualization of the default pattern:
43
+
44
+
```bash
45
+
├── __tests__
46
+
│ └── index.test.js # test
47
+
│ └── App.spec.tsx # test
48
+
│ └── helper.ts # not test
49
+
├── src
50
+
│ └── component.ts # not test
51
+
│ └── component.test.tsx # test
52
+
├── bar.spec.jsx # test
53
+
├── index.test.js # test
54
+
└── index.js # not test
55
+
```
56
+
57
+
It should be noted that if you specify `index.test.ts` as the include pattern, Rstest will only include `index.test.ts` in the root directory. If you want to include `index.test.ts` in all subdirectories, you need to use `**/index.test.ts`.
0 commit comments