Skip to content

Commit beed808

Browse files
committed
Add doc
1 parent dbce189 commit beed808

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

docs/guide/filtering.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,22 @@ basic/foo.test.ts
2424

2525
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.
2626

27+
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+
:::
42+
2743
## Specifying a Timeout
2844

2945
You can optionally pass a timeout in milliseconds as a third argument to tests. The default is [5 seconds](/config/#testtimeout).

0 commit comments

Comments
 (0)