0

Now I use ./vendor/bin/pest as explained in the docs. But that makes me run all tests. What if I only want to run one specific example? Do I need to use groups or can it be done in an easier way?

Brainmaniac
  • 2,203
  • 4
  • 29
  • 53

2 Answers2

4

Filtering of tests isn’t part of the Pest framework, instead that is handled by the underlying test runner. This is most commonly PHPUnit and you can find a list of the CLI options in their docs.

Peppermintology
  • 9,343
  • 3
  • 27
  • 51
0

Append ->only() to the end of the test to run:

test('sum', function () {
  $result = sum(1, 2);
 
  expect($result)->toBe(3);
})->only();

See the docs

None
  • 5,491
  • 1
  • 40
  • 51