|
所在平台: Udemy |
课程主页: https://www.udemy.com/course/unit-testing-typescript-nodejs/
课程评论:没有评论
**TypeScript 与 Node.js 单元测试(Jest)课程总结** 本课程旨在教授开发者如何使用 Jest 这一流行的 JavaScript 测试库,为 TypeScript 和 Node.js 应用程序编写强大、健壮且无 bug 的单元测试。课程内容涵盖从项目设置到高级测试技巧,以及测试驱动开发 (TDD) 和集成测试。 **课程亮点:** * **TypeScript 和 Node.js 单元测试基础:** 学习如何从头开始设置 Node.js 和 TypeScript 项目,并使用 Jest 实现单元测试。 * **Jest 配置与结构:** 深入了解 Jest 的各项配置参数(如 `roots`, `transform`, `testRegex`, `verbose`),以及 `describe`、`test`、hooks(如 `beforeEach`)等测试套件结构。 * **断言与测试双体:** 掌握基本和高级断言,包括原始类型、对象及错误的比较。学习如何创建和使用 mocks, stubs, spies, fakes 等测试双体,并处理“奇怪”的 JavaScript 库。 * **高级测试技巧:** 学习注入双体(构造函数、模块、原型)以及使用 deep mocks 和 matchers 来增强测试。 * **集成测试:** 学习如何为 Node.js 服务器应用程序编写集成测试,以及区分集成测试与单元测试。 * **测试驱动开发 (TDD):** 掌握 TDD 的优势,并通过实践 coding kata(密码检查器)来应用 TDD。 * **React 组件测试(可选):** 涵盖如何使用 Jest 测试 React 组件,包括异步代码和调试 React TypeScript 应用。 * **课程优势:** * **注重效率:** 课程内容精炼,重点突出 Jest 的解释和使用,去除冗余的视频内容。 * **实战经验:** 讲师拥有丰富的行业经验,分享实际应用中的挑战和最佳实践。 * **结构清晰:** 课程分为六个部分,循序渐进,内容一致。 * **代码易查:** 每节课的代码变更均在 Git 上提供 diff,方便回顾和修正。 * **优质观看体验:** 大字体、深色背景、全高清内容,适配各种设备。 * **终身访问与证书:** 提供终身内容访问权限和结业证书。 **您将收获:** * 为 TypeScript 和 Node.js 应用程序编写高质量、安全的单元测试的能力。 * 掌握 Jest 的核心功能,轻松应对复杂的测试场景。 * 提升代码质量和项目稳定性。 **立即报名,在 10 分钟内开始您的测试编写之旅!**
A must have skill for senior developersTypescript is getting more and more popularity and it is a required skill for many IT jobs. It's key feature is type safety, thus preventing bugs. But yes another skill is very important for any programming job: unit testing. Combining these two techniques will result in solid, robust and bug free code.This course will go beyond the basics of unit testing and teach you all you need to write real world, complex testing suites for NodeJs and Typescript applications using the most popular JavaScript testing library: Jest.Using Jest as an unit testing library provides many advantages:Unitary unit testing library for running and structuring testsExtensive mocking, stubbing and spying capabilitiesPowerful matchers to create simple to read testsJest ships as one unitary NPM packageJest is the default choice for TypeScript React projectsWhy unit testing NodeJs apps?Unit testing usually adds a lot to a code base, two or tree times in some cases. This also means that a lot of time needs to be invested in writing and setting up tests. But all this effort pays of: time, effort and headache of fixing bugs can be used for more fun activities.What you will get from this course:setup NodeJs and Typescript projects from scratch implement unit testing with Jestlearn about unit testing configuration with parameters like: roots, transform, testRegex or verboselearn about Jest test suites structure: describe with value, test, descriptions, hooks like beforeEachbasic and advanced assertions, comparing primitive types, objects or even errorsinstantiating test double objects like mocks, stubs, spies or fakes.write complex mock objects which can be used with "strange" JavaScript libraries.inject doubles: directly inside the constructor, over the module or even using the objects prototypelearn about deep mocks and matchers to make your tests even betterintegration tests for a NodeJs server applicationConditionally and asynchronously skip testsDedicated sections on unit testing mocks:Jest mocks, spiesHow to use stubsLondon/Chicago testing approach, with the advantages and disadvantages of each oneIn this course you will learn how to use Test Driven Development (TDD):Analyze the advantages of TDDHands-on practice with a great coding kata: password checkerSeparate section on Jest Integration tests for Rest APIs:learn how to setup integration testslearn the difference between integration tests and unit testswrite integration tests for a Rest API with JestDedicated section on Jest React unit testing:How to test for React components with JestHow to test React async codeHow to debug React Typescript appsThe examples used in the course follow very high coding guidelines for Typescript, NodeJs and React. Async/await syntax is used for clear and concise code, and of course, you will see how to test asynchronous code, on server, but also in the front end.Course advantages:Respect for your time: most of the time of the instructor typing is cut off, the course is focused on unit tests and Jest explanationsConcise: learn only what you need, no fillers to make the course falsely more appealingExperienced and programming active instructor: a great teacher never looses touch with the industry. This is especially true for software development, where the industry is so dynamic. This helps the instructor stay up to date with the best coding guidelines and present you the challenging parts, not the "hello world"Organized course structure: six parts, progressive approach, consistent contentCode changes in each lecture on Git with code diffs: this will help you get an concise overview of the lecture and correct in case you missed somethingBig font, dark background, fullHD content, this way it is readable even on a small screen or even tablet.Lifetime accessCertificate of completion to present to your current or prospective employerDo you want your Typescript or NodeJs code to have the best quality, and your project to be safe?Enroll and start writing your tests in 10 minutes!