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
99
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
81
Aware dependencies using Nx Graph
puppo
0
63
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
88
How to scale up your angular projects like a pro
puppo
0
120
Prisma in the Air
puppo
0
370
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
AI時代におけるSRE、 あるいはエンジニアの生存戦略
pyama86
6
1.2k
Amazon Qを使ってIaCを触ろう!
maruto
0
410
PHP でアセンブリ言語のように書く技術
memory1994
PRO
1
170
受け取る人から提供する人になるということ
little_rubyist
0
250
Ethereum_.pdf
nekomatu
0
470
OnlineTestConf: Test Automation Friend or Foe
maaretp
0
120
ヤプリ新卒SREの オンボーディング
masaki12
0
130
シェーダーで魅せるMapLibreの動的ラスタータイル
satoshi7190
1
480
ペアーズにおけるAmazon Bedrockを⽤いた障害対応⽀援 ⽣成AIツールの導⼊事例 @ 20241115配信AWSウェビナー登壇
fukubaka0825
6
2k
アジャイルを支えるテストアーキテクチャ設計/Test Architecting for Agile
goyoki
9
3.3k
Kaigi on Rails 2024 〜運営の裏側〜
krpk1900
1
240
ローコードSaaSのUXを向上させるためのTypeScript
taro28
1
630
Featured
See All Featured
Testing 201, or: Great Expectations
jmmastey
38
7.1k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
109
49k
Fireside Chat
paigeccino
34
3k
Mobile First: as difficult as doing things right
swwweet
222
8.9k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
131
33k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
27
840
Being A Developer After 40
akosma
87
590k
Fashionably flexible responsive web design (full day workshop)
malarkey
405
65k
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