mirror of
https://github.com/vitest-dev/vitest.git
synced 2025-12-08 18:26:03 +00:00
27 lines
572 B
Markdown
27 lines
572 B
Markdown
---
|
|
title: testNamePattern | Config
|
|
outline: deep
|
|
---
|
|
|
|
# testNamePattern <CRoot /> {#testnamepattern}
|
|
|
|
- **Type** `string | RegExp`
|
|
- **CLI:** `-t <pattern>`, `--testNamePattern=<pattern>`, `--test-name-pattern=<pattern>`
|
|
|
|
Run tests with full names matching the pattern.
|
|
If you add `OnlyRunThis` to this property, tests not containing the word `OnlyRunThis` in the test name will be skipped.
|
|
|
|
```js
|
|
import { expect, test } from 'vitest'
|
|
|
|
// run
|
|
test('OnlyRunThis', () => {
|
|
expect(true).toBe(true)
|
|
})
|
|
|
|
// skipped
|
|
test('doNotRun', () => {
|
|
expect(true).toBe(true)
|
|
})
|
|
```
|