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
98
Aware dependencies using Nx Graph
puppo
0
69
Prisma the ORM that node was waiting for
puppo
0
89
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
78
Other Decks in Programming
See All in Programming
AHC 044 混合整数計画ソルバー解法
kiri8128
0
310
安全に倒し切るリリースをするために:15年来レガシーシステムのフルリプレイス挑戦記
sakuraikotone
5
2.5k
国漢文混用体からHolloまで
minhee
1
120
php-fpm がリクエスト処理する仕組みを追う / Tracing-How-php-fpm-Handles-Requests
shin1x1
5
870
Do Dumb Things
mitsuhiko
0
230
The Evolution of Enterprise Java with Jakarta EE 11 and Beyond
ivargrimstad
0
1.2k
CTFのWebにおける⾼難易度問題について
hamayanhamayan
1
1k
爆速スッキリ! Rspack 移行の成果と道のり - Muddy Web #11
dora1998
1
170
Signal-Based Data FetchingWith the New httpResource
manfredsteyer
PRO
0
110
snacks.nvim内のセットアップ不要なプラグインを紹介 / introduce_snacks_nvim
uhooi
0
360
ミリしらMCP勉強会
watany
4
600
OpenTelemetryを活用したObservability入門 / Introduction to Observability with OpenTelemetry
seike460
PRO
1
370
Featured
See All Featured
Facilitating Awesome Meetings
lara
53
6.3k
How to train your dragon (web standard)
notwaldorf
91
5.9k
We Have a Design System, Now What?
morganepeng
51
7.5k
Practical Orchestrator
shlominoach
186
10k
The Cost Of JavaScript in 2023
addyosmani
48
7.6k
Testing 201, or: Great Expectations
jmmastey
42
7.4k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.4k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.8k
jQuery: Nuts, Bolts and Bling
dougneiner
63
7.7k
Six Lessons from altMBA
skipperchong
27
3.7k
The Art of Programming - Codeland 2020
erikaheidi
53
13k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
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