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
88
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
65
Aware dependencies using Nx Graph
puppo
0
54
Prisma the ORM that node was waiting for
puppo
0
78
How to scale up your projects like a pro
puppo
0
110
Alive, Tipi Sopravvisuti
puppo
0
79
How to scale up your angular projects like a pro
puppo
0
92
Prisma in the Air
puppo
0
290
Can typescript definitions survive even at runtime?
puppo
0
96
Is it possible to build your UI components using only web components?
puppo
0
68
Other Decks in Programming
See All in Programming
Amazon SQSコンシューマー疎結合への旅 - 出張! #DevelopersIO IT技術ブログの中の人が語る勉強会 #3
quiver
0
290
Goのmultiple errorsについて (2024年4月版)
syumai
4
1.1k
Anthropic Cookbook のおすすめレシピ
schroneko
7
1.1k
単体テストを書かない技術 #phpcon_odawara
o0h
PRO
27
8.4k
Going beyond Apache Parquet's default settings
xhochy
0
120
検証も兼ねて個人開発でHonoとかと向き合った話
hanetsuki
1
1.3k
雑に思考を整理する技術と効能
konifar
61
30k
PHPの次期バージョンはこの時期どうなっているのか - Internalsの開発体制について - PHPカンファレンス小田原
youkidearitai
PRO
1
200
Komplexe Oberflächen mit SVG und der Web Animation API
joergneumann
0
680
PostmanでAPIの動作確認が楽になった話
h455h1
0
170
MicrosoftのPlatform Engineeringガイドを読んで実際になにかやってみた
ymd65536
1
480
CA.swift19 恋するAIアプリ開発の裏側
oskmr
0
370
Featured
See All Featured
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
17
1.6k
Learning to Love Humans: Emotional Interface Design
aarron
267
39k
VelocityConf: Rendering Performance Case Studies
addyosmani
321
23k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
660
120k
The Straight Up "How To Draw Better" Workshop
denniskardys
228
130k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
352
28k
Why Our Code Smells
bkeepers
PRO
331
56k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
26
2.3k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
41
4.4k
It's Worth the Effort
3n
180
27k
Fireside Chat
paigeccino
22
2.6k
We Have a Design System, Now What?
morganepeng
44
6.8k
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