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
73
Prisma the ORM that node was waiting for
puppo
0
95
How to scale up your projects like a pro
puppo
0
120
Alive, Tipi Sopravvisuti
puppo
0
100
How to scale up your angular projects like a pro
puppo
0
150
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
83
Other Decks in Programming
See All in Programming
マッチングアプリにおけるフリックUIで苦労したこと
yuheiito
0
190
20250708_JAWS_opscdk
takuyay0ne
2
130
MCPを使ってイベントソーシングのAIコーディングを効率化する / Streamlining Event Sourcing AI Coding with MCP
tomohisa
0
170
Quand Symfony, ApiPlatform, OpenAI et LangChain s'allient pour exploiter vos PDF : de la théorie à la production…
ahmedbhs123
0
220
High-Level Programming Languages in AI Era -Human Thought and Mind-
hayat01sh1da
PRO
0
880
商品比較サービス「マイベスト」における パーソナライズレコメンドの第一歩
ucchiii43
0
180
テスターからテストエンジニアへ ~新米テストエンジニアが歩んだ9ヶ月振り返り~
non0113
2
220
Flutterで備える!Accessibility Nutrition Labels完全ガイド
yuukiw00w
0
170
Goで作る、開発・CI環境
sin392
0
260
Advanced Micro Frontends: Multi Version/ Framework Scenarios @WAD 2025, Berlin
manfredsteyer
PRO
0
390
TypeScriptでDXを上げろ! Hono編
yusukebe
3
770
The Modern View Layer Rails Deserves: A Vision For 2025 And Beyond @ RailsConf 2025, Philadelphia, PA
marcoroth
2
730
Featured
See All Featured
Gamification - CAS2011
davidbonilla
81
5.4k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.4k
Designing Experiences People Love
moore
142
24k
Measuring & Analyzing Core Web Vitals
bluesmoon
7
520
How to Think Like a Performance Engineer
csswizardry
25
1.7k
What’s in a name? Adding method to the madness
productmarketing
PRO
23
3.5k
Faster Mobile Websites
deanohume
308
31k
VelocityConf: Rendering Performance Case Studies
addyosmani
332
24k
Building an army of robots
kneath
306
45k
Testing 201, or: Great Expectations
jmmastey
43
7.6k
Code Reviewing Like a Champion
maltzj
524
40k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.4k
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