The Pest team have just announced the release of Pest 2.0, an advanced PHP testing framework that brings numerous improvements and new features to streamline your testing process. After 18 months of development and over 500 commits, Pest 2.0 is here to elevate your testing experience.

Key Features of Pest 2.0

Pest 2.0 offers a plethora of powerful features that promise to boost productivity and enhance usability, including:

  1. Powerful Architecture Plugin: Easily test the architectural rules of your application.
  2. 60% Speed Improvements: Enjoy significantly faster test runs with the fully rewritten parallel core.
  3. New Options: Optimize test execution with –profile, –retry, –dirty, and more.
  4. Compact Printer: Output information only about test failures for a minimal display.
  5. todo() Method: Stay organized with to-dos in your test suite.
  6. Expectation Interceptors and Pipes: Tailor expectations to fit your specific testing needs.
  7. Scoped Datasets: Create datasets specific to a feature or set of folders.
Nuno Maduro, Creator of Pest during Laracon IN 2023

Revamped Website and Documentation

To complement the release of Pest 2.0, the Pest team has completely redesigned their website and documentation, providing a more user-friendly interface and up-to-date information.

Getting Started with Pest 2.0

Pest 2.0 requires PHP 8.1+ for installation. To get started, follow these steps:

Pest 2.0 requires PHP 8.1+ for installation. To get started, follow these steps:

  • Require Pest as a “dev” dependency in your project using Composer:
composer require pestphp/pest --dev --with-all-dependencies
  • Require Pest as a “dev” dependency in your project using Composer:
composer require pestphp/pest --dev --with-all-dependencies
  • Initialize Pest in your current PHP project to create a Pest.php configuration file:
./vendor/bin/pest --init
  • Run your tests with the pest command:
./vendor/bin/pest

Upgrade from Pest 1.0

For those already using Pest 1.0, the team has provided detailed upgrade instructions in their upgrade guide to ensure a smooth transition to Pest 2.0.

With the release of Pest 2.0, now is the perfect time to explore the benefits and enhancements this powerful PHP testing framework has to offer. Try Pest 2.0 today and experience a more streamlined, efficient testing process.

LEAVE A REPLY

Please enter your comment!
Please enter your name here