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
84
Aware dependencies using Nx Graph
puppo
0
65
Prisma the ORM that node was waiting for
puppo
0
87
How to scale up your projects like a pro
puppo
0
110
Alive, Tipi Sopravvisuti
puppo
0
89
How to scale up your angular projects like a pro
puppo
0
120
Prisma in the Air
puppo
0
380
Can typescript definitions survive even at runtime?
puppo
0
100
Is it possible to build your UI components using only web components?
puppo
0
74
Other Decks in Programming
See All in Programming
Zoneless Testing
rainerhahnekamp
0
120
快速入門可觀測性
blueswen
0
380
今年一番支援させていただいたのは認証系サービスでした
satoshi256kbyte
1
260
Beyond ORM
77web
7
960
「Chatwork」Android版アプリを 支える単体テストの現在
okuzawats
0
180
선언형 UI에서의 상태관리
l2hyunwoo
0
180
rails stats で紐解く ANDPAD のイマを支える技術たち
andpad
1
290
責務を分離するための例外設計 - PHPカンファレンス 2024
kajitack
6
1.4k
ゆるやかにgolangci-lintのルールを強くする / Kyoto.go #56
utgwkk
2
400
PHPUnitしか使ってこなかった 一般PHPerがPestに乗り換えた実録
mashirou1234
0
230
ドメインイベント増えすぎ問題
h0r15h0
2
360
毎日13時間もかかるバッチ処理をたった3日で60%短縮するためにやったこと
sho_ssk_
1
170
Featured
See All Featured
Making the Leap to Tech Lead
cromwellryan
133
9k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
229
52k
Java REST API Framework Comparison - PWX 2021
mraible
28
8.3k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
127
18k
The Pragmatic Product Professional
lauravandoore
32
6.3k
YesSQL, Process and Tooling at Scale
rocio
169
14k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
365
25k
Typedesign – Prime Four
hannesfritz
40
2.4k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
111
49k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
45
2.2k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
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