Loading
Intro to Test Node.js Backends
Transcript
Intro to Test Node.js Backends
Test Node.js Backends
1.
Intro to Test Node.js Backends
2.
Test Pure Functions Overview
3.
Write Unit Tests for a Simple Pure Function
4.
Improve Error Messages by Generating Test Titles
5.
Use jest-in-case to Reduce Duplication and Improve Test Titles
6.
Create a Casify Function to Generate Cases for jest-in-case
7.
Test Node Middleware Overview
8.
Write a Unit Test for Handling an UnauthorizedError
9.
Write a Unit Test for Handling headersSent in an Error Middleware
10.
Write a Unit Test for Status 500 Error Middleware Fallback
11.
Improve Test Maintainability using the Test Object Factory Pattern
12.
Use a Test Object Factory utils/generate
13.
Test Node Controllers Overview
14.
Write a Unit Test for a Controller by Mocking the Database
15.
Simplify Assertions on Error Messages with toMatchInlineSnapshot
16.
Unit Test Business Logic of a Controller’s Middleware
17.
Test Controller 404 Edge Case where Resource is Not Found
18.
Test Controller Unauthorized Case
19.
Test getListItems for Getting Multiple Mock Objects
20.
Test the Happy Path of a Creation Flow
21.
Testing an Error Case for createListItem
22.
Testing the Happy Path for updateListItem
23.
Testing Resource Deletion
24.
Test Authentication API Routes Overview
25.
Start a Node Server and Fire a Request to an HTTP API Endpoint
26.
Make Assertions on HTTP API Responses for Registration
27.
Test the Login Endpoint for a Node Server
28.
Test the User’s Resource Endpoint
29.
Create a Pre-configured axios Client for the baseURL
30.
Improve Error Messages with an axios Interceptor
31.
Ensure a Unique Server Port
32.
Use Snapshots to Assert on Server Error Responses
33.
Interact Directly with the Database
34.
Test all the Edge Cases
35.
Test CRUD API Routes Overview
36.
Write an Integration Test for a Resource Create Endpoint
37.
Write an Integration Test for a Resource Read Endpoint
38.
Integration Test a Resource Update Endpoint
39.
Integration Test a Resource Delete Endpoint
40.
Snapshot the Error Message with Dynamic Data