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
150
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
snapshot testing (laraconus)
Freek Van der Herten
July 25, 2017
More Decks by Freek Van der Herten
See All by Freek Van der Herten
Uncharted packages (ode aan de code)
freekmurze
0
70
Uncharted packages (Laravel Live Denmark)
freekmurze
0
270
I shall define this only once
freekmurze
0
490
An Introduction to Snapshot testing
freekmurze
0
580
Event Sourcing In Laravel
freekmurze
0
290
Building a realtime dashboard with Laravel Livewire (PHPKonf)
freekmurze
0
890
A tour behind the scenes of Oh Dear (PHP Benelux)
freekmurze
2
930
A practical look at multitenancy in Laravel
freekmurze
1
410
A practical look at multitenancy in Laravel (Laracon US)
freekmurze
0
800
Other Decks in Programming
See All in Programming
言語を使う側から、作る側へ。 自作 Lisp で得た新たな気づき。
andpad
0
110
コンテキストの使い捨てをやめる — ビジネスルール駆動開発と miko —
ioki
0
270
Claude Team Plan導入・ガイド
tk3fftk
0
180
SREは、MCPとSRE Agentをこう使え!
kazumax55
0
150
例外の正しい扱い方 そのエラー try-catchして大丈夫?
jinwatanabe
0
360
初めてのKubernetes 本番運用でハマった話
oku053
0
120
「正の参照」と 「負の導出」で組む ハーネスエンジニアリング
cottpan
1
140
LLMによるContent Moderationの本番運用の裏側と品質担保への挑戦
suikabar
3
840
ローカルLLMでどこまでコードが書けるか -拡張版 / How much code can be written on a local LLM Extended
kishida
12
4.7k
技術記事、 専門家としてのプログラマ、 言語化
mizchi
14
7.4k
Generative UI & AI-Assistants for Your Angular Solutions
manfredsteyer
PRO
1
170
「なぜそう決めたのか」を残し続ける仕組み ― Notion AI カスタムエージェント × Slack連携による設計判断の自動記録 - NIKKEI Tech Talk #47
niftycorp
PRO
0
260
Featured
See All Featured
Building a Scalable Design System with Sketch
lauravandoore
463
34k
The Invisible Side of Design
smashingmag
301
52k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.6k
A Tale of Four Properties
chriscoyier
163
24k
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
220
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
6k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
260
Accessibility Awareness
sabderemane
1
150
The untapped power of vector embeddings
frankvandijk
2
1.8k
Ruling the World: When Life Gets Gamed
codingconduct
0
280
How to Think Like a Performance Engineer
csswizardry
28
2.7k
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
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?