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
75
Prisma the ORM that node was waiting for
puppo
0
99
How to scale up your projects like a pro
puppo
0
120
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
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
84
Other Decks in Programming
See All in Programming
2025 年のコーディングエージェントの現在地とエンジニアの仕事の変化について
azukiazusa1
17
8.3k
Zendeskのチケットを Amazon Bedrockで 解析した
ryokosuge
3
270
FindyにおけるTakumi活用と脆弱性管理のこれから
rvirus0817
0
410
Namespace and Its Future
tagomoris
6
690
速いWebフレームワークを作る
yusukebe
5
1.6k
MCPでVibe Working。そして、結局はContext Eng(略)/ Working with Vibe on MCP And Context Eng
rkaga
5
1.7k
AIレビュアーをスケールさせるには / Scaling AI Reviewers
technuma
2
240
サーバーサイドのビルド時間87倍高速化
plaidtech
PRO
0
690
【第4回】関東Kaggler会「Kaggleは執筆に役立つ」
mipypf
0
1k
AIエージェント開発、DevOps and LLMOps
ymd65536
1
380
TDD 実践ミニトーク
contour_gara
1
280
「待たせ上手」なスケルトンスクリーン、 そのUXの裏側
teamlab
PRO
0
190
Featured
See All Featured
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
8
520
Code Review Best Practice
trishagee
70
19k
A designer walks into a library…
pauljervisheath
207
24k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Product Roadmaps are Hard
iamctodd
PRO
54
11k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
61k
We Have a Design System, Now What?
morganepeng
53
7.8k
Java REST API Framework Comparison - PWX 2021
mraible
33
8.8k
GraphQLの誤解/rethinking-graphql
sonatard
71
11k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
580
Being A Developer After 40
akosma
90
590k
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