You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -97,19 +98,36 @@ Pest stores its state at `~/.pest/tia/<project-key>/`, where the project key is
97
98
98
99
Sharing state per remote URL means multiple worktrees of the same repository share one cache, while unrelated projects on the same machine stay isolated.
99
100
101
+
## Configuration
102
+
103
+
You can configure TIA behaviour in `tests/Pest.php` via `pest()->tia()`:
104
+
105
+
```php
106
+
pest()->tia()
107
+
->always() // run TIA on every invocation, no --tia flag needed
108
+
->locally(); // restrict always() to local environments only
109
+
```
110
+
111
+
**`always()`** activates TIA for every `pest` run without requiring the `--tia` flag. Pair it with **`locally()`** to restrict that behaviour to local machines — on CI (detected via the `--ci` flag or the `CI` environment variable) TIA is skipped automatically. An explicit `--tia` on the command line always takes effect regardless.
112
+
113
+
**`filtered()`** enables filtered mode, equivalent to `--tia --filtered`. In this mode Pest narrows PHPUnit to only the affected test files rather than loading the full suite and replaying cached results for unaffected tests:
114
+
115
+
```php
116
+
pest()->tia()->filtered();
117
+
```
118
+
100
119
## Custom Watch Patterns
101
120
102
121
If your project has a directory layout that doesn't match the framework defaults, you can register custom watch patterns in `tests/Pest.php`:
Each glob maps to a list of test directories; whenever a matching file changes, every test under those directories is invalidated. Use this when you have specific test directories that genuinely depend on a file Pest can't see otherwise.
130
+
Each glob maps to a single test directory. Whenever a matching file changes, every test under that directory is invalidated. Duplicate glob keys overwrite the built-in defaults, so you can redirect a pattern to a narrower directory.
0 commit comments