alies-dev/psalm-plugin-pest
| Install | |
|---|---|
composer require alies-dev/psalm-plugin-pest |
|
| Latest Version: | 0.5.0 |
| PHP: | ^8.3 |
| License: | MIT |
| Last Updated: | Nov 6, 2026 |
| Links: | GitHub · Packagist |
Your Pest tests, fully typed. Bugs contained.
This plugin teaches Psalm how Pest really works. Keep your tests in the analysis, get real types and catch broken tests before you run them.
Install
Requires Psalm 7 and Pest 4 or 5.
composer require --dev alies-dev/psalm-plugin-pest
vendor/bin/psalm-plugin enable alies-dev/psalm-plugin-pest
That's it. Make sure tests/ is in <projectFiles> of your psalm.xml.
Before and after
uses(Tests\TestCase::class);
beforeEach(function () {
$this->cart = new Cart();
});
it('totals the cart', function () {
$this->actingAs(admin()); // before: TestCall::__call(), unchecked
// after: Tests\TestCase::actingAs()
$total = $this->cart->total(); // before: TestCall, so $total is TestCall
// after: Cart from beforeEach(), int
expect($total)->toBeString(); // after: PestImpossibleExpectation,
}); // total() returns int
Found a false positive? Open an issue with a snippet.
License
MIT, see LICENSE.
Related Packages
Mago analyzer support for Pest: $this in test closures, dynamic test properties,...
PHPStan extensions to infer Pest closure $this type from test file mappings.
Method-level and class-level maintainability limits (complexity, body lines, par...
A Laravel package to run multiple commands at once, to aid in local development.
Version History
| Version | Released | PHP | License |
|---|---|---|---|
| 0.5.0 | ^8.3 | MIT | |
| 0.4.0 | ^8.3 | MIT | |
| 0.3.0 | ^8.3 | MIT | |
| 0.2.3 | ^8.3 | MIT | |
| 0.2.2 | ^8.3 | MIT | |
| 0.2.1 | ^8.3 | MIT | |
| 0.2.0 | ^8.3 | MIT | |
| 0.1.0 | ^8.3 | MIT |
Pre-releases (2)
| Version | Released | PHP | License |
|---|---|---|---|
| 1.0.0-rc.2 | ^8.3 | MIT | |
| 1.0.0-rc.1 | ^8.3 | MIT |