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
99
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
80
Aware dependencies using Nx Graph
puppo
0
63
Prisma the ORM that node was waiting for
puppo
0
86
How to scale up your projects like a pro
puppo
0
110
Alive, Tipi Sopravvisuti
puppo
0
88
How to scale up your angular projects like a pro
puppo
0
120
Prisma in the Air
puppo
0
360
Can typescript definitions survive even at runtime?
puppo
0
100
Is it possible to build your UI components using only web components?
puppo
0
73
Other Decks in Programming
See All in Programming
推し活としてのrails new/oshikatsu_ha_iizo
sakahukamaki
3
1.7k
Nuxtベースの「WXT」でChrome拡張を作成する | Vue Fes 2024 ランチセッション
moshi1121
1
520
Kaigi on Rails 2024 - Rails APIモードのためのシンプルで効果的なCSRF対策 / kaigionrails-2024-csrf
corocn
5
3.4k
Piniaの現状と今後
waka292
5
1.5k
Vue SFCのtemplateでTypeScriptの型を活用しよう
tsukkee
3
1.5k
カラム追加で増えるActiveRecordのメモリサイズ イメージできますか?
asayamakk
4
1.6k
Synchronizationを支える技術
s_shimotori
1
150
CPython 인터프리터 구조 파헤치기 - PyCon Korea 24
kennethanceyer
0
240
Golang と Erlang
taiyow
8
1.9k
レガシーな Android アプリのリアーキテクチャ戦略
oidy
1
170
CSC509 Lecture 09
javiergs
PRO
0
110
のびしろを広げる巻き込まれ力:偶然を活かすキャリアの作り方/oso2024
takahashiikki
1
410
Featured
See All Featured
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.1k
Reflections from 52 weeks, 52 projects
jeffersonlam
346
20k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Building Your Own Lightsaber
phodgson
102
6k
Why Our Code Smells
bkeepers
PRO
334
57k
Keith and Marios Guide to Fast Websites
keithpitt
408
22k
Bash Introduction
62gerente
608
210k
GraphQLとの向き合い方2022年版
quramy
43
13k
5 minutes of I Can Smell Your CMS
philhawksworth
202
19k
A Tale of Four Properties
chriscoyier
156
23k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
9
680
10 Git Anti Patterns You Should be Aware of
lemiorhan
654
59k
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