feat(tia): continues to work on poc

This commit is contained in:
nuno maduro
2026-04-16 06:59:59 -07:00
parent 30fff116fd
commit b24c375d72
12 changed files with 720 additions and 3 deletions

View File

@ -0,0 +1,38 @@
<?php
declare(strict_types=1);
namespace Pest\Plugins\Tia;
/**
* User-facing TIA configuration, returned by `pest()->tia()`.
*
* Usage in `tests/Pest.php`:
*
* pest()->tia()->watch([
* 'resources/js/**\/*.tsx' => 'tests/Browser',
* 'public/build/**\/*' => 'tests/Browser',
* ]);
*
* Patterns are merged with the built-in defaults (config, routes, views,
* frontend assets, migrations). Duplicate glob keys overwrite the default
* mapping so users can redirect a pattern to a narrower directory.
*
* @internal
*/
final class Configuration
{
/**
* Adds watch-pattern → test-directory mappings that supplement (or
* override) the built-in defaults.
*
* @param array<string, string> $patterns glob → project-relative test dir
* @return $this
*/
public function watch(array $patterns): self
{
WatchPatterns::instance()->add($patterns);
return $this;
}
}