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
ReactDay 2022 - Unit testing
Search
Luca Del Puppo
October 19, 2022
Programming
0
110
ReactDay 2022 - Unit testing
Luca Del Puppo
October 19, 2022
Tweet
Share
More Decks by Luca Del Puppo
See All by Luca Del Puppo
Keep alive your typescript definitions using Zod
puppo
0
120
Aware dependencies using Nx Graph
puppo
0
76
Prisma the ORM that node was waiting for
puppo
0
100
How to scale up your projects like a pro
puppo
0
130
Alive, Tipi Sopravvisuti
puppo
0
110
How to scale up your angular projects like a pro
puppo
0
160
Prisma in the Air
puppo
0
420
Can typescript definitions survive even at runtime?
puppo
0
110
Is it possible to build your UI components using only web components?
puppo
0
85
Other Decks in Programming
See All in Programming
予防に勝る防御なし(2025年版) - 堅牢なコードを導く様々な設計のヒント / Growing Reliable Code PHP Conference Fukuoka 2025
twada
PRO
4
330
お前も Gemini CLI extensions を作らないか?
satohjohn
0
100
Developer Joy - The New Paradigm
hollycummins
1
400
AIと人間の共創開発!OSSで試行錯誤した開発スタイル
mae616
2
870
Webサーバーサイド言語としてのRustについて
kouyuume
1
5.1k
SwiftDataを使って10万件のデータを読み書きする
akidon0000
0
250
Reactive Thinking with Signals and the Resource API
manfredsteyer
PRO
0
120
Kotlinで実装するCPU/GPU 「協調的」パフォーマンス管理
matuyuhi
0
270
モテるデスク環境
mozumasu
3
1.4k
マンガアプリViewerの大画面対応を考える
kk__777
0
450
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
710
AI Agent 時代的開發者生存指南
eddie
4
2.3k
Featured
See All Featured
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
23
1.5k
A designer walks into a library…
pauljervisheath
209
24k
YesSQL, Process and Tooling at Scale
rocio
174
15k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
9
950
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
9.7k
Six Lessons from altMBA
skipperchong
29
4k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.7k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
359
30k
Keith and Marios Guide to Fast Websites
keithpitt
412
23k
Into the Great Unknown - MozCon
thekraken
40
2.1k
Documentation Writing (for coders)
carmenintech
76
5.1k
Transcript
Unit Testing React Day 2022
Ego Slide Luca Del Puppo (aka Puppo) Full-Stack Developer at
Flowing a Claranet Italian Company @puppo92 https://www.linkedin.com/in/lucadelpuppo/
[email protected]
The Test Pyramid
Jest vs React Testing Library (RTL)
Sporchiamoci le mani Example https://puppo.github.io/reactday-2022-workshop-testing/ Code https://github.com/Puppo/reactday-2022-workshop-testing
React Testing Library Selectors
Single Element Type of Query 0 Matches 1 Match >1
Matches Retry (Async/Await) getBy... Throw error Return element Throw error No queryBy... Return null Return element Throw error No findBy... Throw error Return element Throw error Yes
Multiple Elements Type of Query 0 Matches 1 Match >1
Matches Retry (Async/Await) getAllBy... Throw error Return array Return array No queryAllBy... Return [] Return array Return array No findAllBy... Throw error Return array Return array Yes
Query types - Queries Accessible to Everyone - getByRole -
getByLabelText - getByPlaceholderText - getByText - getByDisplayValue - Semantic Queries - getByAltText (img, area, input) - getByTitle - Test IDs - getByTestId
Thanks!
Give me your feedback
Milano Frontend - 25 Ottobre 2022 Registrazione https://tinyurl.com/zawyva9z
NgRome - 02 Ottobre 2022 Sito https://t.co/7Z4wXMapva Coupon (-15%) LucaCarbonara22