Mock REST and GraphQL APIs with Mock Service Worker
Offered By: egghead.io
Course Description
Overview
Controlling the network is the key to fast prototyping, bullet-proof tests, and efficient debugging.
Mocking the APIs you use gives you this kind of control but most methods in the client and server come up short.
That's where Mock Service Worker does it right.
With it you can intercept and take control of requests no matter where they're being made.
In this course, you will learn how to:
* setup and your first request handler
* mock complex flows like authentication
* describe dynamic requests
* respond with HTTP streams,
* and use schema-first GraphQL mocking
After this course you'll be more than ready to bring MSW into your app and start mocking any kind of API you're using!
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
Taught by
Artem Zakharchenko
Related Courses
Web Engineering II: Developing Mobile HTML5 AppsTechnische Hochschule Mittelhessen via iversity Introduction to MongoDB using the MEAN Stack
MongoDB via edX Desarrollo de aplicaciones avanzadas con Android
Universidad Nacional Autónoma de México via Coursera Utilisez des API REST dans vos projets web
IBM via OpenClassrooms Extend Your Application with REST Services
Microsoft via edX