Testing NextJS with React testing library and Jest

preview_player
Показать описание
In this video I test an api route in Next JS using Jest and test the login form using React Testing Library. It is a deeper dive into some of the features of jest and how to handle mocks!

Checkout my some of the other things that I've built and follow me on twitter for the latest nonsense!
Рекомендации по теме
Комментарии
Автор

Awesome video, thanks! I come from a *unit background using assert() so still trying to get my head around these describe() and it()/test() ways of testing lol this video definitely helped me clear my mind on certain differences. Really cool you can nest test suites too!

cajogos
Автор

I always found it difficult to remember those testing ticks, that's very impressive. Great work

caincobain
Автор

First time getting into this tests... Thank you!

DiegoFeder
Автор

You don't need to create a __tests__ folder. Jest also finds files plainly ending in .test.js, or .spec.js. Putting tests next to the actual code file makes it easier to locate them.

noherczeg
Автор

Hey Eric, do you have any video about Jest with Redux? Wrapping dispatch and all that...?

osergiogomess
Автор

You didn't go over how your mongoose services are some how mocked BEFORE your service calls them even though they are imported in your authenticate.js file. How are your mongoose mocks overriding the imports at that are called in your authenticate.js file? That doesn't make any sense. What magic is going on?

nickjunes
welcome to shbcf.ru