UI Testing with React, Mirage, Jest and Testing Library
Video Statistics and Information
Channel: Sam Selikoff
Views: 5,280
Rating: undefined out of 5
Keywords:
Id: 3taVrGZVCr8
Channel Id: undefined
Length: 31min 55sec (1915 seconds)
Published: Fri Oct 25 2019
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.
Looks great! And the video is very pedagogical and instructive.
I have one nitpick, though, about the way you use Testing Library: While your reasoning behind using `getByTestId` to wait for the loader to disappear is sound, the concept behind Testing Library is to test apps the way the user uses them. They go so far as to discourage the use of `getByTestId` unless absolutely necessary, right in the docs. I'd use `getByText` for the loader, and `getByDisplayValue` for the item contents :)
Hey everyone!
I'm working on an API mocking library called Mirage. I made a video about using it with React + Jest so I thought I'd share it here!
You can learn more about the project on https://miragejs.com/. It's not fully launched yet but you can visit the
/docs
route and read the Guides to get a sense of how everything works. Folks have started using it, I'm just working up some last finishing pieces.Would love to hear any questions you have! I'm also curious how people working on React apps are mocking out their APIs today (or if they mock them out at all, and if not, how do they develop + test against them).
Here are some links to the code for the demo
Just a heads up, EmberJS has a mocking library also called mirage so you may want to change the name to avoid confusion.
Does this project have any relationship to https://www.ember-cli-mirage.com ? If not the name could potentially be confused with it since itโs a very common mocking service in the ember JS community.