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
100
Aware dependencies using Nx Graph
puppo
0
69
Prisma the ORM that node was waiting for
puppo
0
90
How to scale up your projects like a pro
puppo
0
120
Alive, Tipi Sopravvisuti
puppo
0
94
How to scale up your angular projects like a pro
puppo
0
130
Prisma in the Air
puppo
0
400
Can typescript definitions survive even at runtime?
puppo
0
110
Is it possible to build your UI components using only web components?
puppo
0
79
Other Decks in Programming
See All in Programming
Strategic Design (DDD)for the Frontend @DDD Meetup Stuttgart
manfredsteyer
PRO
0
120
Bedrock×MCPで社内ブログ執筆文化を育てたい!
har1101
6
970
Sharing features among Android applications: experience feedback
jbvincey
0
100
Code smarter, not harder - How AI Coding Tools Boost Your Productivity | Webinar 2025
danielsogl
0
120
Going Structural with Named Tuples
bishabosha
0
200
サービスクラスのありがたみを発見したときの思い出 #phpcon_odawara
77web
4
640
PHP で学ぶ OAuth 入門
azuki
1
180
自分のために作ったアプリが、グローバルに使われるまで / Indie App Development Lunch LT
pixyzehn
1
160
エンジニア未経験が最短で戦力になるためのTips
gokana
0
270
RuboCop: Modularity and AST Insights
koic
1
210
小田原でみんなで一句詠みたいな #phpcon_odawara
stefafafan
0
320
API for docs
soutaro
2
1.1k
Featured
See All Featured
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.5k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
29
9.4k
Side Projects
sachag
452
42k
How to Think Like a Performance Engineer
csswizardry
23
1.5k
Building a Modern Day E-commerce SEO Strategy
aleyda
40
7.2k
Agile that works and the tools we love
rasmusluckow
328
21k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
4 Signs Your Business is Dying
shpigford
183
22k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
41
2.2k
Building an army of robots
kneath
304
45k
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/ luca@delpuppo.net
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