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
94
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
GraphRAGの仕組みまるわかり
tosuri13
8
530
XP, Testing and ninja testing
m_seki
3
230
#QiitaBash MCPのセキュリティ
ryosukedtomita
0
910
ISUCON研修おかわり会 講義スライド
arfes0e2b3c
0
310
AIコーディング道場勉強会#2 君(エンジニア)たちはどう生きるか
misakiotb
1
280
Node-RED を(HTTP で)つなげる MCP サーバーを作ってみた
highu
0
120
#kanrk08 / 公開版 PicoRubyとマイコンでの自作トレーニング計測装置を用いたワークアウトの理想と現実
bash0c7
1
680
Systèmes distribués, pour le meilleur et pour le pire - BreizhCamp 2025 - Conférence
slecache
0
120
C++20 射影変換
faithandbrave
0
560
既存デザインを変更せずにタップ領域を広げる方法
tahia910
1
270
Team operations that are not burdened by SRE
kazatohiei
1
300
技術同人誌をMCP Serverにしてみた
74th
1
600
Featured
See All Featured
Why Our Code Smells
bkeepers
PRO
337
57k
Rebuilding a faster, lazier Slack
samanthasiow
82
9.1k
The Cost Of JavaScript in 2023
addyosmani
51
8.5k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.7k
Typedesign – Prime Four
hannesfritz
42
2.7k
Visualization
eitanlees
146
16k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
45
7.5k
A designer walks into a library…
pauljervisheath
207
24k
Java REST API Framework Comparison - PWX 2021
mraible
31
8.7k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
4 Signs Your Business is Dying
shpigford
184
22k
It's Worth the Effort
3n
185
28k
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