|
所在平台: Udemy |
课程主页: https://www.udemy.com/course/node-js-api-unit-testing-using-mocha-chai-complete-project/
课程评论:没有评论
## Node.js API 单元测试 - 使用 Mocha 和 Chai - 完整项目 本课程专注于使用 Node.js、Express.js 和 MongoDB 构建 RESTful API,并重点讲解如何使用 Mocha 和 Chai 进行 API 单元测试。 **课程内容概述:** * **REST API 构建:** 学习如何使用 Node.js、Express.js 构建 RESTful API,包括项目组织、路由和控制器设计。 * **MongoDB 数据持久化:** 掌握如何将数据保存到 MongoDB 数据库。 * **Postman API 测试:** 学习使用 Postman 测试 API 端点,执行创建、更新、获取和删除等操作,并了解如何组织和保存 Postman 请求。 * **Mocha & Chai 单元测试:** 深入学习如何使用 Mocha 和 Chai 为所有 API 端点编写单元测试。 * **Chai 断言:** 掌握 Chai 提供的多种断言函数,用于验证测试结果。 * **HTTP 请求:** 学习使用 Axios 发送 HTTP 请求。 * **状态码应用:** 理解 REST API 中不同状态码的含义和使用场景,以及如何在 Mocha 和 Chai 测试中应用它们。 * **测试报告生成:** 学习如何生成测试报告。 完成本课程后,您将能够独立构建和全面测试 Node.js API。
Welcome to this course. In this course, you will learn API Unit Testing using mocha and chai. At first, you will learn how to build the rest API using node js, express js, and MongoDB. You will learn how to test the API endpoint in postman. I will show you how to organize and save the endpoint in postman. Using postman we will be able to perform all sorts of things like create, update, get, and delete operations.After that, you will learn how to add unit testing for the API using mocha and chai. We will add different sorts of testing for all of our API endpoints.Here are some lists that you are gonna learn from this course:How to build rest API.API End-point unit testing using mocha and chai.How to save data to MongoDB database.How to organize node js project, routing, and controller of node js app.How to use postman to test API endpoint.How to add Mocha Chai test for each and every API endpoint.How to use different kinds of assertion functions of chai in the test.How to generate a test report after doing all the testDifferent kinds of status codes need to use with mocha chai testing.How to choose status code when building rest API.How to use Axios to do HTTP requests.