Home
Categories
EXPLORE
True Crime
Comedy
Business
Society & Culture
History
Sports
Health & Fitness
About Us
Contact Us
Copyright
© 2024 PodJoint
00:00 / 00:00
Sign in

or

Don't have an account?
Sign up
Forgot password
https://is1-ssl.mzstatic.com/image/thumb/Podcasts125/v4/f3/de/0e/f3de0ec1-a1ff-ad7e-1d42-2ee41cae7253/mza_7142444209140500111.png/600x600bb.jpg
3 Minutes with Kent
Kent C. Dodds
235 episodes
8 months ago
👋 Hi there! I'm Kent C. Dodds (https://twitter.com/kentcdodds). This is a (week)daily podcast where I give 3 minute thoughts about web development. You can subscribe on iTunes here: http://kcd.im/3-mins-itunes and on RSS here: http://kcd.im/3-mins-rss
Show more...
Technology
RSS
All content for 3 Minutes with Kent is the property of Kent C. Dodds and is served directly from their servers with no modification, redirects, or rehosting. The podcast is not affiliated with or endorsed by Podjoint in any way.
👋 Hi there! I'm Kent C. Dodds (https://twitter.com/kentcdodds). This is a (week)daily podcast where I give 3 minute thoughts about web development. You can subscribe on iTunes here: http://kcd.im/3-mins-itunes and on RSS here: http://kcd.im/3-mins-rss
Show more...
Technology
https://briefs-production.s3.amazonaws.com/cover_art/34/Drawing__1_.png
Tests the tests by making them fail
3 Minutes with Kent
2 minutes 33 seconds
4 years ago
Tests the tests by making them fail
https://kentcdodds.com/blog/make-your-test-fail Hello there friends. I'm just driving now. I was thinking about a blog post that I wrote a while ago. I think it was called break your tests or something like that, but the idea is that it's just really easy to write a test that passes and so you feel really good about it this this especially happens if you're testing after you've already implemented something if you're doing TDD this is maybe less of a problem, but it's really easy to write a test that's green and we're happy with it and,So we commit it and we move on and then we later find out that that test wasn't running to completion or it was the it wasn't testing what we thought it was testing wasn't making the right assertions or something and so it wasn't actually doing what we thought it was and so then the thing that we were intending to test ends up breaking in that test doesn't doesn't save us from that and so what I suggest that you do is you take the time to actually try and make the thing that you're testing break, so you simulate a failure this could be. I'm pretty much like any any step of the process of what it is that you're testing maybe you're making a request to get some data and then you're displaying that data in your asserting that the data is displayed properly and so you could just comment out the code that updates the state or something like that and so it's normally very easy and it's a manual check. I don't think that there would be a whole lot of use in like at this point you're testing the tests and I don't see a whole lot of benefit and like how far do you go, do you test the test the test the test?It's just sorry cracking myself up um yeah so like at some point you have to say okay, we're good with just doing a manual verification of this and so that's that's what this is is just a manual verification that yes this is indeed testing what I think it is and I verified that by commenting out the implementation or changing the implementation and in a certain way to make sure that the test will catch me if I mistakenly change the implementation in this way, so yeah, as you're writing your test for your software, I suggest that you break the test and I will. Add a link to the blog post where I dive into this little in a little bit more detail at the top of the notes for this episode so you can go take a look at that. I hope you have a wonderful day and we will chat with you later bye.
3 Minutes with Kent
👋 Hi there! I'm Kent C. Dodds (https://twitter.com/kentcdodds). This is a (week)daily podcast where I give 3 minute thoughts about web development. You can subscribe on iTunes here: http://kcd.im/3-mins-itunes and on RSS here: http://kcd.im/3-mins-rss