mirror of
https://github.com/pestphp/pest.git
synced 2026-03-09 01:07:23 +01:00
Adds a new method, isInParallel, to the Testable trait to allow a test to determine its parallel status.
This commit is contained in:
15
tests/Features/Parallel.php
Normal file
15
tests/Features/Parallel.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
use Pest\TestSuite;
|
||||
|
||||
it('can determine in the test case if it is running in parallel', function () {
|
||||
expect(test()->isInParallel())->toBeTrue();
|
||||
})->skip(!TestSuite::getInstance()->isInParallel);
|
||||
|
||||
it('can determine in the test case if it is not running in parallel', function () {
|
||||
expect(test()->isInParallel())->toBeFalse();
|
||||
})->skip(TestSuite::getInstance()->isInParallel);
|
||||
|
||||
it('can skip using the test case based on parallel status', function () {
|
||||
expect(TestSuite::getInstance()->isInParallel)->toBeFalse();
|
||||
})->skip(function () { return $this->isInParallel(); });
|
||||
Reference in New Issue
Block a user