Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
snapshot testing (laraconus)
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Freek Van der Herten
July 25, 2017
Programming
0
130
snapshot testing (laraconus)
Freek Van der Herten
July 25, 2017
Tweet
Share
More Decks by Freek Van der Herten
See All by Freek Van der Herten
Uncharted packages (ode aan de code)
freekmurze
0
48
Uncharted packages (Laravel Live Denmark)
freekmurze
0
240
I shall define this only once
freekmurze
0
460
An Introduction to Snapshot testing
freekmurze
0
530
Event Sourcing In Laravel
freekmurze
0
270
Building a realtime dashboard with Laravel Livewire (PHPKonf)
freekmurze
0
850
A tour behind the scenes of Oh Dear (PHP Benelux)
freekmurze
2
890
A practical look at multitenancy in Laravel
freekmurze
1
390
A practical look at multitenancy in Laravel (Laracon US)
freekmurze
0
760
Other Decks in Programming
See All in Programming
TerraformとStrands AgentsでAmazon Bedrock AgentCoreのSSO認証付きエージェントを量産しよう!
neruneruo
4
2.6k
プロダクトオーナーから見たSOC2 _SOC2ゆるミートアップ#2
kekekenta
0
150
疑似コードによるプロンプト記述、どのくらい正確に実行される?
kokuyouwind
0
360
Oxlintはいいぞ
yug1224
5
1.2k
16年目のピクシブ百科事典を支える最新の技術基盤 / The Modern Tech Stack Powering Pixiv Encyclopedia in its 16th Year
ahuglajbclajep
5
940
Denoのセキュリティに関する仕組みの紹介 (toranoana.deno #23)
uki00a
0
270
OCaml 5でモダンな並列プログラミングを Enjoyしよう!
haochenx
0
100
AI Agent の開発と運用を支える Durable Execution #AgentsInProd
izumin5210
7
2.2k
副作用をどこに置くか問題:オブジェクト指向で整理する設計判断ツリー
koxya
1
560
ELYZA_Findy AI Engineering Summit登壇資料_AIコーディング時代に「ちゃんと」やること_toB LLMプロダクト開発舞台裏_20251216
elyza
2
1.3k
AgentCoreとHuman in the Loop
har1101
5
200
組織で育むオブザーバビリティ
ryota_hnk
0
160
Featured
See All Featured
How to make the Groovebox
asonas
2
1.9k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
130
What does AI have to do with Human Rights?
axbom
PRO
0
2k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
48
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
1
110
The Cost Of JavaScript in 2023
addyosmani
55
9.4k
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.7k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
196
71k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2k
Discover your Explorer Soul
emna__ayadi
2
1.1k
Transcript
A practical intro to snapshot testing
Pronouncing Dutch Michael 3/10 Jacob 1/10
Pronouncing Dutch Michael 9/10 Jacob 9/10
Drake
Frake
Pronouncing Dutch: Spatie Spa Sea
LET’S TALK SNAPSHOT TESTING
A file on disk, let’s call in snapshot Test succeeds
if output matches snapshot If not, test will fail What?
Old name: characterization testing Popularized by Facebook Jest Testing interfaces
Where does it come from?
https://github.com/spatie/phpunit-snapshot-assertions assertMatchesSnapshot assertMatchesJsonSnapshot assertMatchesXmlSnapshot How can we do it in
PHP?
DEMO
WRAPPING UP
Advantages Very easy to get started with Can be used
to validate complex output Easily update all the tests in one go
Disadvantages Brittle Hard to pinpoint exact point of failure Bugs
can be easily written in the snapshots
https://github.com/spatie/phpunit-snapshot-assertions https://sebastiandedeyne.com/posts/2017/a-package-for-snapshot- testing-in-phpunit https://murze.be/2017/04/practical-introduction-snapshot-testing/ https://www.sitepoint.com/snapshot-testing-viable-php/ https://facebook.github.io/jest/docs/snapshot-testing.html Interesting links
Thank you! https://speakerdeck.com/freekmurze/snapshot-testing-laraconus https://spatie.be/opensource https://murze.be https://murze.be/newsletter/
QUESTIONS?