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
110
Aware dependencies using Nx Graph
puppo
0
72
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
97
How to scale up your angular projects like a pro
puppo
0
140
Prisma in the Air
puppo
0
410
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
Rails産でないDBを Railsに引っ越すHACK - Omotesando.rb #110
lnit
1
100
がんばりすぎないコーディングルール運用術
tsukakei
1
180
What Spring Developers Should Know About Jakarta EE
ivargrimstad
1
620
Rethinking Data Access: The New httpResource in Angular
manfredsteyer
PRO
0
220
DevDay2025-OracleDatabase-kernel-addressing-history
oracle4engineer
PRO
7
1.6k
人には人それぞれのサービス層がある
shimabox
3
470
〜可視化からアクセス制御まで〜 BigQuery×Looker Studioで コスト管理とデータソース認証制御する方法
cuebic9bic
2
270
Efficiency and Rock 'n’ Roll (Really!)
hollycummins
0
600
複雑なフォームを継続的に開発していくための技術選定・設計・実装 #tskaigi / #tskaigi2025
izumin5210
12
6.4k
ワイがおすすめする新潟の食 / 20250530phpconf-niigata-eve
kasacchiful
0
260
「兵法」から見る質とスピード
ickx
0
200
eBPFを用いたAIネットワーク監視システム論文の実装 / eBPF Japan Meetup #4
yuukit
3
620
Featured
See All Featured
[RailsConf 2023] Rails as a piece of cake
palkan
55
5.6k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
26k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
14
1.5k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
45
7.3k
How STYLIGHT went responsive
nonsquared
100
5.6k
Embracing the Ebb and Flow
colly
85
4.7k
A designer walks into a library…
pauljervisheath
205
24k
Designing for Performance
lara
608
69k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
15
890
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
10
850
VelocityConf: Rendering Performance Case Studies
addyosmani
329
24k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
19
1.3k
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