Typing the Test Suite

所在平台: Udemy

课程主页: https://www.udemy.com/course/typing-the-test-suite/

课程评论:没有评论

第一个写评论        关注课程

课程简介

课程名称:Typing the Test Suite 课程概述: 本课程是针对中级开发者的快速入门课程,帮助他们开始使用Jest和TypeScript进行测试。课程的第一部分集中在使用JavaScript和一些测试驱动开发(TDD)上,后续部分则使用TypeScript和Jest,结合Node.js或React进行深度学习。课程时长为2小时,内容丰富,讲究快速实践和错误修复,重点在于编写测试以确保代码的稳定性。 使用的技术: - Jest (v26) - TypeScript (v4) - React.js (v17) - React Testing Library (v11) 适合人群: 本课程适合已经具备一定JavaScript/TypeScript、Node.js和React经验的开发者,尤其是那些希望学习如何编写测试的自我驱动的初学者。 所需知识: 学员需具备基础的JavaScript知识,Node.js部分需要了解基本的Node.js/Express知识,React部分则要求对React有一定了解。测试概念与特定框架关系不大,只要有一些编程经验即可。 课程大纲: 1.0 介绍 - 设置环境并开始编写Jest测试 1.1 安装 1.2 您的第一个测试 1.3 添加断言 1.4 描述与分组测试 1.5 使用观察模式的反馈循环 1.6 使用it.each进行简洁测试 2.0 项目:字符串计算器 - 将第一部分学到的技能应用到字符串计算器Kata中 2.1 第一个测试 2.2 处理空格 2.3 抛出错误 2.4 测试错误 2.5 通过功能重构验证测试套件 2.6 完成功能重构 3.0 匹配器深入 - 深入探讨Jest提供的各种匹配器 3.1 toBe 3.2 toEqual, not 3.3 toHaveProperty 3.4 处理Promise的resolves匹配器 3.5 处理错误的rejects匹配器 3.6 测试调用次数的toHaveBeenCalled和模拟函数 3.7 使用Done回调进行等待 4.0 TypeScript、Node.js与Jest - 通过开发和测试Node.js API来介绍TypeScript和Jest 4.1 TypeScript和Jest与ts-jest 4.2 Express配置 4.3 Jest生命周期:Before和After钩子 4.4 更好的类型 4.5 添加JWT及重构 4.6 授权头的处理 4.7 成功测试 4.8 失败测试 4.9 替代的失败断言语法 4.10 总结 5.0 TypeScript、React与DOM环境测试 - 构建一个简单的React应用,学习如何使用TypeScript和Jest进行基于DOM的测试 5.1 创建React应用与TypeScript 5.2 使用Testing Library的渲染 5.3 Testing Library的断言 - getByText 5.4 useState与异步断言 5.5 使用useEffect获取数据 5.6 findAll中的更多异步行为 5.7 使用Jest Mock模拟Axios 5.8 切换待办事项状态 6.0 Jest技巧与技巧 - 学习Jest的一些高级功能,编写您自己的自定义匹配器,并创建更强大、可重用和(大部分)类型安全的Mocks 6.1 部分概述 6.2 自定义匹配器API 6.3 实现匹配器 6.4 类型定义匹配器 6.5 模块Mocking设置 6.6 逐行Mock审查 6.7 Inline Mocks的问题 6.8 手动Mocks 6.9 默认模块数据 6.10 Mock模块的类型定义 6.11 改善规范类型 6.12 Jest Spy 6.13 下一步?更多学习资源 如果您有更多问题,请发送电子邮件与我联系。

课程评论(0条)

课程详情

What is this?A quick course for intermediate level developers looking to get started with testing using Jest and TypeScript.The first section focuses on using Jest with JavaScript and a bit of TDD. The rest of the course uses TypeScript, Jest, with either Node.js or React. It's 2 hours long and full of content.We move fast, break things, then write tests to make sure they don't break again. The technologies used are:Jest (v26)TypeScript (v4)React.js (v17)React Testing Library (v11)Who is this for?Developers with some JavaScript/TypeScript, Node.js and React experience who'd like to learn to write tests.Highly motivated beginner who likes to jump in the deep end.Required knowledgeI assume students have basic JavaScript knowledge. The Node.js section assumes basic Node.js/Express knowledge, and the React section assumes some React knowledge. The testing concepts are largely unrelated to those specific frameworks, so as long as you have some programming experience, you should be fine.Curriculum1.0 IntroductionGet everything setup and starting writing some tests with Jest.1.1 Installation1.2 Your First Test1.3 Adding an Assertion1.4 Describing and Grouping Tests1.5 Feedback Loop with Watch Mode1.6 It.each for Concise Tests2.0 Project: String CalculatorPut the skills learned in section one into practice by completing the String Calculator Kata.2.1 The First Test2.2 Handling Whitespace2.3 Throwing an Error2.4 Testing the Error2.5 Validating the Test Suite with a Functional Refactor2.6 Completing the Functional Refactor3.0 Matcher MadnessDo a deep dive into the various matchers Jest provides, from toBe and toEqual to the more exotic resolves and rejects matchers.3.1 toBe3.2 toEqual, not3.3 toHaveProperty3.4 Resolves matcher for Promises3.5 Rejects matcher for Errors3.6 toHaveBeenCalled and Mock Functions3.7 Waiting with the Done Callback4.0 TypeScript, Node.js and JestWe introduce TypeScript and Jest by developing and testing a Node.js API. Note: This section assumes basic knowledge of Node.js and Express.4.1 TypeScript and Jest with ts-jest4.2 Express Setup4.3 The Jest Lifecylce: Before and After Hooks4.4 Better Types4.5 Adding JWT and a Refactor4.6 Authorization Header4.7 Testing for Success4.8 Testing for Failure4.9 Alternative Failed Assertion Syntax4.10 Summary5.0 TypeScript, React and Testing in a DOM EnvironmentBuild a toy React app and see how to use TypeScript and Jest for DOM based testing with Testing Library. Note: this section assumes basisc knowledge of React.5.1 Create React App and TypeScript5.2 Rendering with Testing Library5.3 Testing Library Assertions - getByText5.4 useState and Asynchronous Assertions5.5 Fetchign Data with useEffect5.6 More Async Behavior with findAll5.7 Mocking Axios with Jest Mocks5.8 Toggling Todos6.0 Jest Tips and TricksLearn some of Jest's more advanced features. Write your own custom matchers with TypeScript and write more robust, reuseable and (mostly) type-safe mocks.6.1 Section Overview6.2 Custom Matcher API6.3 Implementing the Matcher6.4 Typing the Matcher6.5 Setting up for Module Mocking6.6 Inline Mocks Review6.7 The Problem with Inline Mocks6.8 Manual Mocks6.9 Default Module Data6.10 Typing the Mock Module6.11 Improving the Spec Types6.12 Jest Spies6.13 What Next? More Learning ResourcesI have more questions!Send me an email.

课程标签

0人关注该课程

主题相关的课程