Description
In this course, you will learn:
- setup and your first request handler
- mock complex flows like authentication
- describe dynamic requests
- respond with HTTP streams,
- and use schema-first GraphQL mocking
Syllabus:
- Introduction to Mock REST and GraphQL APIs with Mock Service Worker
- Clone the GitHub Repository for Mock REST and GraphQL APIs with Mock Service Worker
- Install Mock Service Worker (MSW) and Prepare Directory Structure
- Set Up MSW in the Browser
- Set Up MSW in Node.js
- Intercept and Mock Server-Side HTTP Requests in MSW
- Use the HttpResponse Class in MSW
- Handle Dynamic Requests with Path Parameters in MSW
- Add a Single Source of Truth for Fixtures in MSW
- Intercept and Mock Client-Side HTTP Requests in MSW
- Read Request Query Parameters in MSW
- Mock Error Responses in MSW
- Emulate Network Errors in MSW
- Control Response Timing in MSW
- Use MSW to Mock Authentication in Remix
- Intercept and Mock GraphQL Queries in MSW
- Intercept and Mock GraphQL Mutations in MSW
- Mock GraphQL Errors in MSW
- Resolve GraphQL Requests Against a Mock Schema in MSW
- Mock All GraphQL Operations in MSW
- Endpoint-Based GraphQL Mocking in MSW
- Perform Intercepted Requests As-Is in MSW
- Combine Original and Mocked Responses in MSW
- Respond With a ReadableStream in MSW