Enable Test Impact Analysis (TIA) by Default in pest.php

Punyapal Shah
Configure Pest to run Test Impact Analysis by default in pest.php so only tests covering modified files execute.

Running full test suites on every minor edit slows down development feedback. Configuring TIA in pest.php automatically detects file changes and runs only affected tests.

// tests/Pest.php
uses()
    ->compact()
    ->in(__DIR__);

// Run only tests covering changed code automatically
// Terminal: ./vendor/bin/pest --tia
  • Slashes test execution duration during rapid local iterations
  • Tracks code coverage artifacts to identify tests covering edited lines
  • Can be toggled via CLI flag --tia or environment config
Tags: #Pest #Testing #DX
Share on X

// Found an issue or want to contribute a tip? github.com/MrPunyapal/tips