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
110
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
120
Aware dependencies using Nx Graph
puppo
0
76
Prisma the ORM that node was waiting for
puppo
0
100
How to scale up your projects like a pro
puppo
0
120
Alive, Tipi Sopravvisuti
puppo
0
110
How to scale up your angular projects like a pro
puppo
0
160
Prisma in the Air
puppo
0
420
Can typescript definitions survive even at runtime?
puppo
0
110
Is it possible to build your UI components using only web components?
puppo
0
85
Other Decks in Programming
See All in Programming
contribution to astral-sh/uv
shunsock
0
560
When Dependencies Fail: Building Antifragile Applications in a Fragile World
selcukusta
0
110
フロントエンド開発のためのブラウザ組み込みAI入門
masashi
7
3.6k
alien-signals と自作 OSS で実現する フレームワーク非依存な ロジック共通化の探求 / Exploring Framework-Agnostic Logic Sharing with alien-signals and Custom OSS
aoseyuu
2
790
bootcamp2025_バックエンド研修_WebAPIサーバ作成.pdf
geniee_inc
0
140
Temporal Knowledge Graphで作る! 時間変化するナレッジを扱うAI Agentの世界
po3rin
4
970
Vueのバリデーション、結局どれを選べばいい? ― 自作バリデーションの限界と、脱却までの道のり ― / Which Vue Validation Library Should We Really Use? The Limits of Self-Made Validation and How I Finally Moved On
neginasu
2
1.7k
TFLintカスタムプラグインで始める Terraformコード品質管理
bells17
2
480
スマホから Youtube Shortsを見られないようにする
lemolatoon
27
34k
What's new in Spring Modulith?
olivergierke
1
180
EMこそClaude Codeでコード調査しよう
shibayu36
0
470
SODA - FACT BOOK(JP)
sodainc
1
8.9k
Featured
See All Featured
How to Think Like a Performance Engineer
csswizardry
27
2.2k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
9
940
Designing for Performance
lara
610
69k
Docker and Python
trallard
46
3.6k
The Language of Interfaces
destraynor
162
25k
KATA
mclloyd
PRO
32
15k
Thoughts on Productivity
jonyablonski
71
4.9k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
2
160
How STYLIGHT went responsive
nonsquared
100
5.9k
Side Projects
sachag
455
43k
How GitHub (no longer) Works
holman
315
140k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
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