Curso React JS Testing Basics com Jest + React Testing Library

  • Web UX Design Era Digital

Curso React JS Testing Basics com Jest + React Testing Library

12h
Visão Geral

Este curso apresenta os fundamentos dos testes em aplicações React utilizando Jest e React Testing Library (RTL). Você aprenderá por que testar, como estruturar testes, como testar componentes, eventos, hooks e comportamentos essenciais. Tudo de forma simples, direta e prática, preparando você para escrever testes confiáveis em qualquer projeto React.

Objetivo

Após realizar este curso, você será capaz de:

  • Configurar Jest e React Testing Library em projetos React.
  • Criar testes básicos e intermediários para componentes.
  • Simular eventos, interações e mudanças de estado.
  • Testar hooks, funções e comportamentos do usuário.
  • Aplicar boas práticas e escrever testes limpos e organizados.
  • Garantir maior confiabilidade em aplicações React.
Publico Alvo
  • Iniciantes e intermediários em React.
  • Devs front-end que nunca testaram código.
  • Pessoas que querem melhorar a qualidade do código e evitar bugs.
  • Quem busca vagas profissionais que exigem testes automatizados.
Pre-Requisitos
  • React básico (componentes, hooks, estado).
  • Noções de JavaScript moderno.
Conteúdo Programatico

Module 1 – Introduction to Testing

  1. Why testing matters
  2. Types of tests (unit, integration, E2E)
  3. How Jest and RTL work together
  4. Understanding testing philosophy

Module 2 – Setting Up the Environment

  1. Installing Jest and RTL
  2. Required configurations
  3. Test folder structure
  4. Running the first test

Module 3 – Jest Fundamentals

  1. Test blocks (describe, test, it)
  2. matchers (toBe, toEqual, toHaveBeenCalled…)
  3. Mocking functions and modules
  4. Snapshot testing basics

Module 4 – React Testing Library Essentials

  1. Rendering components
  2. getBy vs queryBy vs findBy
  3. Best practices for querying elements
  4. Understanding the screen object

Module 5 – Testing Interactions

  1. Click, change, typing and form events
  2. Simulating user behavior with userEvent
  3. Testing state changes
  4. Testing error and loading states

Module 6 – Testing Components

  1. Testing props
  2. Testing conditional rendering
  3. Testing async components
  4. Mocking APIs and fetch calls

Module 7 – Testing Custom Hooks

  1. Using renderHook
  2. Testing hook logic and return values
  3. Mocking dependencies

Module 8 – Best Practices & Common Patterns

  1. What to test and what not to test
  2. Avoiding implementation details
  3. Organizing tests by domain
  4. Minimizing brittle tests

Module 9 – Final Project

  • Creating a small React application
  • Writing tests for:
  1. Components
  2. Inputs/forms
  3. Hooks
  4. API calls
  • Achieving consistent test coverage
TENHO INTERESSE

Cursos Relacionados

Curso Adobe Captivate Foundation

16 horas

Curso Adobe Captivate Advanced

16 horas

Curso Algoritmos Visual Foundation

16 horas

Curso Web Performance and Optimisation

Curso Web Performance and Optimisation

Curso Adobe Animate Foundation

16 horas

Curso PHP Developer Foundation

32 horas