fix missing datasets when defined in Pest.php file

This commit is contained in:
Fabio Ivona
2023-08-29 10:49:17 +02:00
parent 14859a4c89
commit 5d6b717c9a
3 changed files with 17 additions and 0 deletions

View File

@ -4,6 +4,8 @@ declare(strict_types=1);
namespace Pest\Support;
use function Pest\testDirectory;
/**
* @internal
*/
@ -25,6 +27,10 @@ final class DatasetInfo
public static function scope(string $file): string
{
if (Str::endsWith($file, testDirectory('Pest.php'))) {
return dirname($file);
}
if (self::isInsideADatasetsDirectory($file)) {
return dirname($file, 2);
}