Udemy
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
Development
Web Development Data Science Mobile Development Programming Languages Game Development Database Design & Development Software Testing Software Engineering Development Tools No-Code Development
Business
Entrepreneurship Communications Management Sales Business Strategy Operations Project Management Business Law Business Analytics & Intelligence Human Resources Industry E-Commerce Media Real Estate Other Business
Finance & Accounting
Accounting & Bookkeeping Compliance Cryptocurrency & Blockchain Economics Finance Finance Cert & Exam Prep Financial Modeling & Analysis Investing & Trading Money Management Tools Taxes Other Finance & Accounting
IT & Software
IT Certification Network & Security Hardware Operating Systems Other IT & Software
Office Productivity
Microsoft Apple Google SAP Oracle Other Office Productivity
Personal Development
Personal Transformation Personal Productivity Leadership Career Development Parenting & Relationships Happiness Esoteric Practices Religion & Spirituality Personal Brand Building Creativity Influence Self Esteem & Confidence Stress Management Memory & Study Skills Motivation Other Personal Development
Design
Web Design Graphic Design & Illustration Design Tools User Experience Design Game Design Design Thinking 3D & Animation Fashion Design Architectural Design Interior Design Other Design
Marketing
Digital Marketing Search Engine Optimization Social Media Marketing Branding Marketing Fundamentals Marketing Analytics & Automation Public Relations Advertising Video & Mobile Marketing Content Marketing Growth Hacking Affiliate Marketing Product Marketing Other Marketing
Lifestyle
Arts & Crafts Beauty & Makeup Esoteric Practices Food & Beverage Gaming Home Improvement Pet Care & Training Travel Other Lifestyle
Photography & Video
Digital Photography Photography Portrait Photography Photography Tools Commercial Photography Video Design Other Photography & Video
Health & Fitness
Fitness General Health Sports Nutrition Yoga Mental Health Dieting Self Defense Safety & First Aid Dance Meditation Other Health & Fitness
Music
Instruments Music Production Music Fundamentals Vocal Music Techniques Music Software Other Music
Teaching & Academics
Engineering Humanities Math Science Online Education Social Science Language Teacher Training Test Prep Other Teaching & Academics
AWS Certification Microsoft Certification AWS Certified Solutions Architect - Associate AWS Certified Cloud Practitioner CompTIA A+ Cisco CCNA Amazon AWS CompTIA Security+ AWS Certified Developer - Associate
Graphic Design Photoshop Adobe Illustrator Drawing Digital Painting InDesign Character Design Canva Figure Drawing
Life Coach Training Neuro-Linguistic Programming Personal Development Mindfulness Personal Transformation Meditation Life Purpose Coaching Emotional Intelligence
Web Development JavaScript React CSS Angular PHP WordPress Node.Js Python
Google Flutter Android Development iOS Development Swift React Native Dart Programming Language Mobile Development Kotlin SwiftUI
Digital Marketing Google Ads (Adwords) Social Media Marketing Google Ads (AdWords) Certification Marketing Strategy Internet Marketing YouTube Marketing Email Marketing Retargeting
SQL Microsoft Power BI Tableau Business Analysis Business Intelligence MySQL Data Analysis Data Modeling Data Cleaning
Business Fundamentals Entrepreneurship Fundamentals Business Strategy Online Business Business Plan Startup Freelancing Blogging Home Business
Unity Game Development Fundamentals Unreal Engine C# 3D Game Development C++ 2D Game Development Unreal Engine Blueprints Blender
30-Day Money-Back Guarantee

This course includes:

  • 2.5 hours on-demand video
  • 4 articles
  • Full lifetime access
  • Access on mobile and TV
Development Software Testing TDD Test Driven Development

Testing React apps with React Testing Library (RTL)

Learn how to test React components with React Testing Library, the recommended library from Facebook for testing.
Rating: 4.2 out of 54.2 (88 ratings)
504 students
Created by David Armendáriz
Last updated 11/2020
English
English [Auto]
30-Day Money-Back Guarantee

What you'll learn

  • The principles of Test Driven Development (TDD)
  • Know what React Testing Library is and its differences with Enzyme
  • Understand how Jest works with React Testing Library
  • Query elements with getBy, queryBy, findBy, getAllBy, queryAllBy, findAllBy
  • Simulate user interaction with the fireEvent and userEvent API
  • Learn about coverage and debugging
  • How to mock third party libraries like Axios
  • How to use Typescript with a React app
Curated for the Udemy for Business collection

Course content

8 sections • 25 lectures • 2h 37m total length

  • Preview09:23
  • Preview04:01

  • Join the community!
    00:12

  • The repo for this course
    00:07
  • Create React App behind the scenes
    08:49

  • Understanding Jest
    04:46
  • Writing our first test
    11:22

  • A little mistake!
    00:24
  • Rendering a component with RTL
    12:54
  • Selecting elements with getByText
    07:01
  • Selecting elements with getByRole
    07:53
  • queryBy search variant
    06:23
  • findBy search variant (Part 1)
    07:00
  • findBy search variant (Part 2)
    10:11
  • A little mistake in one of the tests!
    00:18
  • findBy search variant (Part 3)
    06:42
  • Querying multiple elements
    06:15
  • User interaction with the fireEvent function
    07:31
  • User interaction with the user event API
    02:52
  • Testing a component in isolation with the user event API
    08:13

  • Coverage
    07:12
  • Debugging
    04:28

  • Creating a Pokemon component
    10:42
  • Testing the Pokemon component
    10:45

  • Jest DOM library from RTL
    01:41

Requirements

  • Be famliarized with React components

Description

Welcome to testing React components with React Testing Library! In this course, you will learn lots of things. You will learn:

  • The principles of Test Driven Development

  • Know what is React Testing Library (RTL) and its differences with Enzyme (another popular test framework for React)

  • Understand how Create React App (CRA) works.

  • Understand how Jest works with RTL

  • How to test with RTL and query elements with:

    • getBy, queryBy, findBy, getAllBy, queryAllBy, findAllBy

  • How to simulate user interaction with the fireEvent API

  • How to simulate user interaction with the userEvent API

  • Testing components in isolation (unit tests)

  • Learn about coverage and debugging

  • How to mock 3rd party libraries like Axios and mock a GET request

  • Learn about the pitfalls of CRA

You will have all the fundamental tools to test any React component and have that coverage at 100%!

Have fun, and never stop learning!

Who this course is for:

  • Web developers
  • Full stack developers
  • Developers interested in Test Driven Development
  • Front-end developers

Instructor

David Armendáriz
Mathematician & Software Developer
David Armendáriz
  • 4.2 Instructor Rating
  • 211 Reviews
  • 1,378 Students
  • 5 Courses

Hi! My name is David Armendáriz. I am ecuadorian.

I studied mathematics at USFQ (Universidad San Francisco de Quito). However, I love coding and that's why I transitioned to the software industry. I love to share my knowledge here in Udemy and in YouTube.

I hope you enjoy my courses as much as I enjoy doing them and remember: never stop learning!

  • Udemy for Business
  • Teach on Udemy
  • Get the app
  • About us
  • Contact us
  • Careers
  • Blog
  • Help and Support
  • Affiliate
  • Terms
  • Privacy policy
  • Cookie settings
  • Sitemap
  • Featured courses
Udemy
© 2021 Udemy, Inc.