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
140
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
ReactDay 2022 - Unit testing
Luca Del Puppo
October 19, 2022
More Decks by Luca Del Puppo
See All by Luca Del Puppo
Keep alive your typescript definitions using Zod
puppo
0
170
Aware dependencies using Nx Graph
puppo
0
99
Prisma the ORM that node was waiting for
puppo
0
140
How to scale up your projects like a pro
puppo
0
150
Alive, Tipi Sopravvisuti
puppo
0
150
How to scale up your angular projects like a pro
puppo
0
210
Prisma in the Air
puppo
0
480
Can typescript definitions survive even at runtime?
puppo
0
160
Is it possible to build your UI components using only web components?
puppo
0
120
Other Decks in Programming
See All in Programming
ALB ログから Trace を気合で繋げる技術
fohte
7
770
初めての模倣学習とVLA
natsutan
0
320
思考垂れ流し開発 ~音声入力 × AIエージェント × 開発ハーネスによる試行錯誤~
npostring
0
410
AI時代に学ぶ 好きなルール 嫌いなルール Linter編
shorty5121
0
200
高専、大学編入、そして未踏へ〜プロダクト開発とキャリアの歩み - Technical College, University Transfer, and On to “Mitou” / My Journey in Product Development and Career
pkmiya
0
100
freeeにおけるEvalsの実践例の紹介
freee
PRO
0
160
夏だ!祭りだ!祭りとはドメインモデリングでは?
ryugen04
0
440
Cloudflare is Agents
chimame
0
180
AIの中の人になってみる
htkym
0
140
komatsuna「分散システムにおけるバグ分析手法」
komatsunaqa
0
290
高専キャリア LT 発表内容
crysta1221
4
4.3k
MySQLとPostgreSQLって何が違うの?
akagami
0
150
Featured
See All Featured
Deep Space Network (abreviated)
tonyrice
0
270
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
4
500
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
420
Exploring anti-patterns in Rails
aemeredith
3
480
The Cost Of JavaScript in 2023
addyosmani
55
10k
Facilitating Awesome Meetings
lara
57
7.1k
Navigating Weather and Climate Data
rabernat
0
490
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
220
KATA
mclloyd
PRO
35
15k
Leo the Paperboy
mayatellez
8
2.2k
Writing Fast Ruby
sferik
630
63k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
3k
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