feat: deprecates only feature

This commit is contained in:
Nuno Maduro
2023-02-14 08:40:02 +00:00
parent ea6af719e0
commit a61db76c24
8 changed files with 8 additions and 88 deletions

View File

@ -3,7 +3,6 @@
use Pest\Exceptions\DatasetMissing;
use Pest\Exceptions\TestAlreadyExist;
use Pest\Factories\TestCaseMethodFactory;
use Pest\Plugins\Environment;
use Pest\TestSuite;
it('does not allow to add the same test description twice', function () {
@ -40,39 +39,3 @@ it('can return an array of all test suite filenames', function () {
'c',
]);
});
it('can filter the test suite filenames to those with the only method', function () {
$testSuite = new TestSuite(getcwd(), 'tests');
$testWithOnly = new TestCaseMethodFactory('a', 'b', null);
$testWithOnly->only = true;
$testSuite->tests->set($testWithOnly);
$testSuite->tests->set(new TestCaseMethodFactory('c', 'd', null));
expect($testSuite->tests->getFilenames())->toEqual([
'a',
]);
});
it('does not filter the test suite filenames to those with the only method when working in CI pipeline', function () {
$previousEnvironment = Environment::name();
Environment::name(Environment::CI);
$testSuite = new TestSuite(getcwd(), 'tests');
$test = function () {
};
$testWithOnly = new TestCaseMethodFactory('a', 'b', null);
$testWithOnly->only = true;
$testSuite->tests->set($testWithOnly);
$testSuite->tests->set(new TestCaseMethodFactory('c', 'd', null));
expect($testSuite->tests->getFilenames())->toEqual([
'a',
'c',
]);
Environment::name($previousEnvironment);
});