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
88
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
130
Prisma in the Air
puppo
0
390
Can typescript definitions survive even at runtime?
puppo
0
100
Is it possible to build your UI components using only web components?
puppo
0
76
Other Decks in Programming
See All in Programming
AWSのLambdaで PHPを動かす選択肢
rinchoku
2
390
Запуск 1С:УХ в крупном энтерпрайзе: мечта и реальность ПМа
lamodatech
0
930
ATDDで素早く安定した デリバリを実現しよう!
tonnsama
1
1.7k
「とりあえず動く」コードはよい、「読みやすい」コードはもっとよい / Code that 'just works' is good, but code that is 'readable' is even better.
mkmk884
6
1.4k
PHPとAPI Platformで作る本格的なWeb APIアプリケーション(入門編) / phpcon 2024 Intro to API Platform
ttskch
0
380
毎日13時間もかかるバッチ処理をたった3日で60%短縮するためにやったこと
sho_ssk_
1
530
どうして手を動かすよりもチーム内のコードレビューを優先するべきなのか
okashoi
3
860
Package Traits
ikesyo
1
200
AppRouterを用いた大規模サービス開発におけるディレクトリ構成の変遷と問題点
eiganken
1
440
Simple組み合わせ村から大都会Railsにやってきた俺は / Coming to Rails from the Simple
moznion
2
2k
HTML/CSS超絶浅い説明
yuki0329
0
190
ISUCON14感想戦で85万点まで頑張ってみた
ponyo877
1
570
Featured
See All Featured
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
860
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
GraphQLの誤解/rethinking-graphql
sonatard
68
10k
Agile that works and the tools we love
rasmusluckow
328
21k
GitHub's CSS Performance
jonrohan
1030
460k
Fashionably flexible responsive web design (full day workshop)
malarkey
406
66k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
How GitHub (no longer) Works
holman
312
140k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
How STYLIGHT went responsive
nonsquared
96
5.3k
What's in a price? How to price your products and services
michaelherold
244
12k
Navigating Team Friction
lara
183
15k
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