How to Mock a REST API Server for Testing with Jest & React Testing Library

preview_player
Показать описание


⭐ Become a full-stack web dev with Zero To Mastery Courses:

👇 Follow Me On Social Media:

How to Mock a REST API Server for Testing with Jest & React Testing Library

(00:00) Intro
(00:14) Welcome
(00:38) Prerequisites & Starter Code
(01:00) Lesson Goal
(01:07) Adding Dependencies
(02:39) Mock REST API Server Setup
(08:57) Async Unit Testing
(13:38) Modify the Server Response for a test
(16:18) Completing the Mock Endpoint handlers
(19:02) Completing the CRUD Unit Tests
(23:18) Adding the Async CRUD functions to the app
(30:11) Adding New & Updating Integration Tests
(41:14) Unit Test Update
(43:27) Wrap-up

📚 Tutorial References:

Was this tutorial about how to create a Mock REST API Server and async testing helpful? If so, please share. Let me know your thoughts in the comments.

#mock #rest #api
Рекомендации по теме
Комментарии
Автор

Excellent!. Thank you so much Dave on this testing tutorial.

gmjitendra
Автор

Mah man on 208k subs??? You're growing too fast man you deserve all! last time i view your vids you're just on 70k subs.

johnpaulpineda
Автор

Exactly this type of content but with Vitest. Great work and thank you

adeyemiadeyanju
Автор

Here you are again... Another topic I discovered and another one you already covered.... thanks a lot

yourcasualdeveloper
Автор

Hey Dave
please explain about edge and node runtime in NextJs
and please teach us NestJs.
thank you
I learned so much from you.

Habib-ocsingv
Автор

Hi Dave, I've just started watching your web dev tutorials.
Does your playlist named "full course programming " follows a specific sequence that aligns with web dev roadmap? Thanks for all the valuable content you provide! 👏

himanshurai
Автор

Unfortunately, msw doesn't support request, carrying FormData and binary payload ...

jora
Автор

Hi Programmers. In folder ./lib fetch request's ( await fetch("/todos")). For working app need to use Route Handlers. Did I understand correctly?

maxpayne
Автор

Hi Dave 👋 How many more videos we can expect to complete this playlist? Approximately!!!

anirudh
Автор

Hi I am using next js 13 app deployed on amplify aws but it gives me html chunks code after some time please tell me any solution.

shubhamsrmn
Автор

Are you planning to do a video about cypress?

male
Автор

when i run test i get err - TextEncoder is not defined

storozhukua
Автор

at 10:32 you created a fetch. If I use fetch to real api should I create this fetch as fake or it should be request to real url?

yuliasereda