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
100
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
100
Aware dependencies using Nx Graph
puppo
0
70
Prisma the ORM that node was waiting for
puppo
0
91
How to scale up your projects like a pro
puppo
0
120
Alive, Tipi Sopravvisuti
puppo
0
95
How to scale up your angular projects like a pro
puppo
0
140
Prisma in the Air
puppo
0
400
Can typescript definitions survive even at runtime?
puppo
0
110
Is it possible to build your UI components using only web components?
puppo
0
81
Other Decks in Programming
See All in Programming
「”誤った使い方をすることが困難”な設計」で良いコードの基礎を固めよう / phpcon-odawara-2025
taniguhey
0
170
AWS で実現する安全な AI エージェントの作り方 〜 Bedrock Engineer の実装例を添えて 〜 / how-to-build-secure-ai-agents
gawa
8
870
State of Namespace
tagomoris
4
1.9k
Lambda(Python)の リファクタリングが好きなんです
komakichi
3
220
On-the-fly Suggestions of Rewriting Method Deprecations
ohbarye
1
3.4k
KawaiiLT 登壇資料 キャリアとモチベーション
hiiragi
0
150
The Nature of Complexity in John Ousterhout’s Philosophy of Software Design
philipschwarz
PRO
0
130
Cursor/Devin全社導入の理想と現実
saitoryc
23
17k
エンジニア向けCursor勉強会 @ SmartHR
yukisnow1823
0
890
エンジニアが挑む、限界までの越境
nealle
1
270
ComposeでのPicture in Picture
takathemax
0
120
Java 24まとめ / Java 24 summary
kishida
3
500
Featured
See All Featured
Making the Leap to Tech Lead
cromwellryan
133
9.2k
Designing for humans not robots
tammielis
252
25k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
160
15k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
13
790
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
45
9.5k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
12k
How to Ace a Technical Interview
jacobian
276
23k
Agile that works and the tools we love
rasmusluckow
328
21k
The Invisible Side of Design
smashingmag
299
50k
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3.1k
Art, The Web, and Tiny UX
lynnandtonic
298
20k
Rails Girls Zürich Keynote
gr2m
94
13k
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