|
所在平台: Udemy |
课程主页: https://www.udemy.com/course/react-testing-app/
课程评论:没有评论
**课程名称:** React - 测试 **课程概要:** 本课程将带您深入实践 React 应用的测试,而非仅仅停留在理论层面。您不仅能获得测试知识,还能积累宝贵的实战经验。课程将专注于 Web 应用在 React 中的测试,详细阐述测试的价值以及如何选择适合 React 应用的测试工具。 课程内容涵盖测试的多个方面,包括:单元测试、集成测试、快照测试、测试运行器、`describe`、`before` 和 `after` 测试块, `skip tests`、循环、匹配器 (`matchers`)、真值 (truthy) 和假值 (falsy) 的判断、组件渲染 (`render component`)、触发事件 (`fire event`)、模拟 (`mocking`)、API 请求 (`fetching API`)、`act`、`wait` 等众多重要概念和技术。 完成本课程后,您将能够从容应对测试动态 React 应用时遇到的各种挑战。课程将通过编写大量不同类型的测试来覆盖各种技术,以及如何选择特定元素并与之交互。 **学习路径:** 1. **Jest 入门:** 首先,我们将学习 Jest,了解如何运行和编写测试。在此阶段,我们将聚焦于 Jest 本身,将其作为测试运行器,不涉及 React 应用。 2. **React Testing Library:** 掌握 Jest 后,我们将安装并学习 React Testing Library。您将了解该库的工作原理及其提供的各种功能,包括组件渲染和触发各种事件。 3. **实战 React 应用测试:** 课程的核心部分将是测试真实的 React 应用。我们将使用一个已有的 React 应用,并运用不同的测试技术来测试其中的组件。课程将涵盖 React 的最新趋势,如 `useState` 和 `useEffect` hooks。 4. **解决实际测试问题:** 完成此阶段后,您将了解在编写 React 测试时可能遇到的问题,更重要的是,您将学会如何使用 Jest 和 React Testing Library 来有效地解决这些问题。
This course is not just a theory and bullet points about testing React. In this course, we test real application and you will gain not just knowledge but also practice.We will focus on testing web application in React. I will explain why it's worth testing and what tools we should pick for testing react application. We will be talking about many different aspects of testing: Unit tests, integration tests, snapshots, test runner, describe, before and after tests, skip tests, loops, matchers, truthy and falsy, render component, fire event, mocking, fetching API, act, wait and many more. After this tutorial, you will be able to handle many obstacles with testing the dynamic applications in React. We will write a lot of different tests to cover different technics and ways to select certain elements and interact with them. The first tool that we will learn will be Jest. I will show you how to run tests and write them. At this level, we will write tests without React application. We will focus on Jest only and use it as our test runner.After we will know what is Jest and how it works, we will install our first application with React Testing Library. I will show you how that library works and what options do we have with it. We will render our components and we will trigger different events.The main section of this tutorial will be testing the real React app. We will have a ready app, written in React and we will start using different technics to test our components. We will be using the newest trends in React like hooks with useState and useEffect. When you finish that chapter, you will know what kind of problems you might have when writing your own tests for React and more importantly, how to solve them with Jest and React Testing Library.