Oh Dear is the all-in-one monitoring tool for your entire website. We monitor uptime, SSL certificates, broken links, scheduled tasks and more. You'll get a notifications for us when something's wrong. All that paired with a developer friendly API and kick-ass documentation. O, and you'll also be able to create a public status page under a minute. Start monitoring using our free trial now.

Pest v2: see all new amazing features in action

Original – by Freek Van der Herten – 3 minute read

The release of Pest v2 is right around the corner. Pest creator Nuno Maduro and the rest of the Pest team are currently working hard improving the docs ahead of the Pest v2 release somewhere later this month.

In this blog post, I'd like to share the free videos I've created for each of the amazing features.

New in Pest v2

Pest v2 brings many exciting new features such as the retrying testing, profiling slow tests, support for the new arch plugin and much more.

One of the best "features" of Pest v2 is that it contains no breaking changes. This means you can start using Pest v2 without have to modify any of your Pest v1 (or PHPUnit) tests.

For our Testing Laravel premium course, I've recorded new videos on each of the new Pest v2 features.

The new arch plugin

This powerhouse plugin lets you easiliy define architecture rules for your app.

Retrying Failed Tests

You can now easily rerun all tests that failed previously.

Profiling slow tests

Pest can show you a list of slowest tests.

Intercepting expectations

You can now customize the built-in expecations.

Writing todo's in your test suite

Pest now has a nice way to remind you that you should still write some tests.

The new compact printer

If you think Pest is too verbose by default, use the new mimimal printer.

How to install Pest v2 right now

At the moment of writing, Pest v2 isn't released yet, but you can already use it in your projects.

You simply need to require ^2.0 of Pest and ^7.0 of nunomaduro/collision in your composer.json. Also add the right configuration for minimum-stability and prefer-stable so composer is allowed to pull in unreleased packages.

"require-dev": {
       "pestphp/pest": "^2.0",
       "nunomaduro/collision": "^7.0",
    
       // other dependencies
    },
    "minimum-stability": "dev",
    "prefer-stable": true
}

With this in place, you'll download the latest dev version of Pest v2. When Pest v2 is released this will automatically pull in the stable version.

I've been using the dev version of Pest v2 for quite some time now on larger projects, and it works without any problems.

Some more Pest videos

Like mentioned before, I've created an entire video course on Pest. I've made some of the videos free.

Testing the homepage

This is probably a good first test.

Testing Middleware

Here's an easy way to test any middleware.

Snapshot testing

Here's how you can test big chunks of output or API requests

You can see all videos on the course page.

In closing

Pest v2 is an amazing release, Nuno and his team did a great job on it.

If you don't know how to start a Laravel application yet, consider picking up our Testing Laravel premium course, which was updated for Pest v2.

Stay up to date with all things Laravel, PHP, and JavaScript.

You can follow me on these platforms:

On all these platforms, regularly share programming tips, and what I myself have learned in ongoing projects.

Every month I send out a newsletter containing lots of interesting stuff for the modern PHP developer.

Expect quick tips & tricks, interesting tutorials, opinions and packages. Because I work with Laravel every day there is an emphasis on that framework.

Rest assured that I will only use your email address to send you the newsletter and will not use it for any other purposes.

Comments

Comments powered by Laravel Comments
Want to join the conversation? Log in or create an account to post a comment.