Twitter | Search | |
Kent C. Dodds 🌌
Improving the world w/ quality software Β· Husband, Father, Latter-day Saint, Teacher, OSS Β· Β· Β· Be Kind
101,861
Tweets
678
Following
110,619
Followers
Tweets
Kent C. Dodds 🌌 3h
Yes
Reply Retweet Like
Kent C. Dodds 🌌 3h
Reply Retweet Like
Kent C. Dodds 🌌 3h
Replying to @malloc007
Reply Retweet Like
Kent C. Dodds 🌌 4h
Replying to @MiniYoda1
react-query has been awesome for all my projects, big and small.
Reply Retweet Like
Kent C. Dodds 🌌 4h
And even if you have an app that has class components, learn just enough about them to be able to refactor them to function components when you need to change them. πŸ˜‰
Reply Retweet Like
Kent C. Dodds 🌌 4h
Replying to @mpjme @emilcardell
And the only network level stuff in here is when I'm testing what happens when a network request fails.
Reply Retweet Like
Kent C. Dodds 🌌 4h
Replying to @mpjme @emilcardell
I get a ton of my confidence and code coverage for my app from these tests: When it fails, I have a good idea of what triggered the failure. And when I refactor, this helps me make sure I didn't break anything.
Reply Retweet Like
Kent C. Dodds 🌌 4h
Replying to @mpjme @emilcardell
My bookshelf app has more complex examples :-)
Reply Retweet Like
Kent C. Dodds 🌌 4h
Replying to @mpjme @dmitrigrabov
Please don't set fire to yourself. I'd be happy to walk you through those kinds of situations.
Reply Retweet Like
Kent C. Dodds 🌌 4h
Replying to @mpjme @t_dfgomes
Also, if you want to pair sometime I think that could be fun :-)
Reply Retweet Like
Kent C. Dodds 🌌 4h
The docs are super good already :-) And you can look at for a reference implementation
Reply Retweet Like
Kent C. Dodds 🌌 4h
Replying to @mpjme @t_dfgomes
Specifically: πŸ“š
Reply Retweet Like
Kent C. Dodds 🌌 4h
Replying to @mpjme @t_dfgomes
If you want a good example of an MSW setup, you can check out my material for
Reply Retweet Like
Kent C. Dodds 🌌 4h
Cypress + Cypress Testing Library is a winning combination for E2E πŸ‘
Reply Retweet Like
Kent C. Dodds 🌌 4h
Replying to @rahulballal7 @mpjme
When he tweeted this it was 3:00 a.m. for me πŸ˜„
Reply Retweet Like
Kent C. Dodds 🌌 4h
Replying to @mpjme
Several people have already mentioned my MSW post and that's what I recommend. but if there's a component that you don't want to render, you can always mock it using jest.mock. This video is a bit dated, but still very applicable:
Reply Retweet Like
Kent C. Dodds 🌌 4h
Replying to @ApiMocking
I may write it eventually, but I put it on the back burner for now.
Reply Retweet Like
Kent C. Dodds 🌌 4h
Replying to @mpjme @t_dfgomes
(with the exception of end-to-end test of course)
Reply Retweet Like
Kent C. Dodds 🌌 4h
Replying to @mpjme @t_dfgomes
If you successfully mock your entire back end then you don't need to think about it in 99% of your tests. It takes a lot of effort, but it makes your test super solid and give you confidence during refactorings better than anything else I know.
Reply Retweet Like
Kent C. Dodds 🌌 14h
Replying to @yashguptaz
Thank you 😊
Reply Retweet Like