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
97
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
78
Aware dependencies using Nx Graph
puppo
0
63
Prisma the ORM that node was waiting for
puppo
0
86
How to scale up your projects like a pro
puppo
0
110
Alive, Tipi Sopravvisuti
puppo
0
87
How to scale up your angular projects like a pro
puppo
0
110
Prisma in the Air
puppo
0
350
Can typescript definitions survive even at runtime?
puppo
0
100
Is it possible to build your UI components using only web components?
puppo
0
73
Other Decks in Programming
See All in Programming
実践!難読化ガイド
mitchan
0
200
Pythonで改めて考える「クラス(class)」の使いどころ
os1ma
1
470
Perl 5 OOP機構30年史 - Perl 5's OOP Mechanism over the past 30 years
moznion
0
270
【TID2024】模擬講義:プログラマと一緒にゲームをデザインしてみよう!
akatsukigames_tech
0
660
LangChainでWebサイトの内容取得やGitHubソースコード取得
shukob
0
160
Some more adventure of Happy Eyeballs
coe401_
2
190
The Shape of a Service Object
inem
0
520
Amazon Neptuneで始める初めてのグラフDB ー グラフDBを使う意味を考える ー
satoshi256kbyte
2
260
RAGの回答精度評価用のQAデータセットを生成AIに作らせた話
kurahara
0
250
connect-go で面倒くささと戦う / 2024-08-27 #newmo_layerx_go
izumin5210
2
650
LangChainの現在とv0.3にむけて
os1ma
4
920
はじめてみよう量子プログラミング
itokoichi01
0
210
Featured
See All Featured
Producing Creativity
orderedlist
PRO
340
39k
The Power of CSS Pseudo Elements
geoffreycrofte
71
5.3k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
43
2k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.4k
Done Done
chrislema
180
16k
How to train your dragon (web standard)
notwaldorf
85
5.6k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
26
1.9k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
26
2k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
663
120k
Fireside Chat
paigeccino
31
2.9k
Build your cross-platform service in a week with App Engine
jlugia
228
18k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
278
13k
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