AI-powered
podcast player
Listen to all your favourite podcasts with AI-powered features
How Do You Write Unit Tests?
Tests are really just like if this is the request that the user sends, what should the appropriate response be? And that's exactly what documentation is also. So when you're writing your tests, how much differently do you write your tests to make the documents look appropriate? Do you have to? Not at all. It's super simple. There's like maybe six lines of code that you have to add. But essentially, if you have really good, really thorough unit tests, like testing for user passes nil and user passes opposed with no request data and all of that, all of those requests are captured. When you can see in the documentation, when you pass nil, this happens.