testNamePattern

  • Type: string | RegExp
  • Default: undefined

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.

// skipped
test('test foo', () => {
  expect(true).toBe(true);
});

// run
test('test bar', () => {
  expect(true).toBe(true);
});