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/guide/filtering.md
+15
Original file line number
Diff line number
Diff line change
@@ -24,6 +24,21 @@ basic/foo.test.ts
24
24
25
25
You can also use the `-t, --testNamePattern <pattern>` option to filter tests by full name. This can be helpful when you want to filter by the name defined within a file rather than the filename itself.
26
26
27
+
Since Vitest 2.2, you can also specify the test by filename and line number:
28
+
29
+
```bash
30
+
$ vitest basic/foo.test.ts:10
31
+
```
32
+
33
+
::: warning
34
+
Note that you have to specify the full filename, and specify the exact line number, i.e. you can't do
35
+
36
+
```bash
37
+
$ vitest foo:10
38
+
$ vitest basic/foo.test.ts:10-25
39
+
```
40
+
:::
41
+
27
42
## Specifying a Timeout
28
43
29
44
You can optionally pass a timeout in milliseconds as a third argument to tests. The default is [5 seconds](/config/#testtimeout).
0 commit comments