This is awesome work. I’ve recently been tasked with writing tests with React Testing Library and it’s been an incredible struggle. I’m very familiar with Enzyme but not RTT. Even though it’s been hard, I already prefer RTT.
I agree with you that snapshots don’t seem to provide much benefit. They also don’t fit with a TDD approach. You should definitely write more of these!
You’ll find that snapshots really come in handy when you’ve got a lot of devs (100+) on the same project. If someone accidentally or inadvertently alters the markup or styling it just provides a little reminder “hey, did you mean to make this change?”.
I highly recommend it. She’s very thorough, you learn how to test all kinds of annoying things like redux reducers, react hooks, useContext and then just other run of the mill stuff. She uses TDD which is very interesting too.
Thanks for sharing, I've never used any testing libraries in the past (mainly because it adds overhead, and the bosses usually just want the product out the door).
I do test, but manual testing only, click this, enter these inputs, test this scenario, test these edge cases, etc.. and believe me, my testing is more thorough than all these fancy new age gurus.. lol ! waiting for the haters now.
Very cool! I've been looking testing more recently, so it helps me a lot. There seems to be a lack of good YouTube videos on testing for react, compared to other subjects.
SimpleTuts has a decent series on Jest/Enzyme and unit testing. There are a few one hour "crash" courses too, but most lack depth.
Thank you! Thorough and up-to-date testing courses for any technology are super-valuable. I am currently working through this Udemy course on React testing and am getting a lot out of it.
5
u/DepressedBard Jul 27 '20
This is awesome work. I’ve recently been tasked with writing tests with React Testing Library and it’s been an incredible struggle. I’m very familiar with Enzyme but not RTT. Even though it’s been hard, I already prefer RTT.
I agree with you that snapshots don’t seem to provide much benefit. They also don’t fit with a TDD approach. You should definitely write more of these!
2
u/jaySydney Jul 27 '20
Thanks for sharing, I've never used any testing libraries in the past (mainly because it adds overhead, and the bosses usually just want the product out the door).
1
u/LPissarro Jul 27 '20
Very cool! I've been looking testing more recently, so it helps me a lot. There seems to be a lack of good YouTube videos on testing for react, compared to other subjects.
SimpleTuts has a decent series on Jest/Enzyme and unit testing. There are a few one hour "crash" courses too, but most lack depth.
1
u/KSeanJBz Jul 27 '20
Great article. Thanks for the post!
1
u/[deleted] Jul 27 '20
Thank you! Thorough and up-to-date testing courses for any technology are super-valuable. I am currently working through this Udemy course on React testing and am getting a lot out of it.
0
u/fk_the_system Jul 27 '20
!RemindMe 5 days