testNamePattern
- Type:
string | RegExp
- Default:
undefined
- CLI:
-t=<value>
, --testNamePattern=<value>
Run only tests with a name that matches the regex / string.
If you set testNamePattern
to bar
, tests not containing the word bar
in the test name will be skipped.
import { defineConfig } from '@rstest/core';
export default defineConfig({
testNamePattern: 'bar',
});
// skipped
test('test foo', () => {
expect(true).toBe(true);
});
// run
test('test bar', () => {
expect(true).toBe(true);
});