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.

A practical introduction to snapshot testing

Link –

While working a little bit on laravel-sitemap I decided to refactor the tests to make use of our own snapshot assertions package. The snapshot package enables you to generate snapshots with the output of your tests. On subsequent runs of those tests it can assert if the output still matches the contents of the snapshot.

In this video I demonstrate how the refactor of the tests of laravel-sitemap was done. (double-click on it to view it full-screen)

If you want to know more about snapshot testing, then read this blog post written by my colleague Sebastian. The refactor of the tests can be viewed in this commit on GitHub.

(Little note on the video itself: this is my first tutorial video I ever made. After recording it I noticed that I used a wrong ratio resulting in those black bars on the side. Ah well, you live you learn. Next time it will be better. For those interested, I used a Blue Yeti Pro mic to record my voice and ScreenFlow to record and edit the video.)

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

What are your thoughts on "A practical introduction to snapshot testing"?

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

Webmentions

Cyril de Wit liked on 31st October 2019
Ramiro Varandas Jr liked on 31st October 2019
Hamid Alaei ? liked on 31st October 2019
Wesley van Klaveren liked on 31st October 2019
Peter Sowah retweeted on 31st October 2019
Peter Sowah liked on 31st October 2019
Matthew Poulter liked on 31st October 2019
pxgamer liked on 31st October 2019
Roman Pronskiy liked on 31st October 2019
Niels liked on 31st October 2019
Vadim Bondarenko liked on 31st October 2019
Mohamed Said liked on 31st October 2019
이현석 Hyunseok Lee liked on 31st October 2019
oluwajubelo loves VueJS ? liked on 31st October 2019
John liked on 31st October 2019
oluwajubelo loves VueJS ? retweeted on 31st October 2019
Maruf Alom liked on 31st October 2019
Mark Myers liked on 31st October 2019
Neil Carlo Faisan Sucuangco liked on 31st October 2019
danish mehmood retweeted on 31st October 2019
Zayn Buksh liked on 31st October 2019
Spatie retweeted on 31st October 2019
Ihsan Berahim liked on 31st October 2019
Michael Timbs liked on 31st October 2019
CONTOURS liked on 31st October 2019
Shodipo Ayomide liked on 31st October 2019
Michael Dyrynda retweeted on 31st October 2019
ダビッド トレス liked on 31st October 2019
Jess Budd @ LaraconAU liked on 31st October 2019
Gelado retweeted on 31st October 2019
ダビッド トレス retweeted on 31st October 2019
Rutvij liked on 31st October 2019
Gelado liked on 31st October 2019
Marcel Pociot ? retweeted on 31st October 2019
Sebastian De Deyne liked on 31st October 2019
Robin Dirksen liked on 31st October 2019
Alexis Rojas liked on 31st October 2019