From the course: Build with AI: Developing a Code Review Assistant

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Test harness development: Mocking GitHub API responses

Test harness development: Mocking GitHub API responses

From the course: Build with AI: Developing a Code Review Assistant

Test harness development: Mocking GitHub API responses

- [Instructor] Adding tests and reviewing the code before we start launching this action is, I think, essential. So if we take a look at what we have here, we have a single function, which is the run function, right? It has everything in there, and then it executes at the very bottom, at the very end, the run function. So this might be kind of okay. Like if we don't care about anything, (laughs) this might be maybe somehow acceptable, but if certain things are failing within these lines, like say for example, the common body is not well constructed, well, we start getting into trouble. So testing is essential. So I'm going to get out of this file, and I'm going to go to Gemini. So I'm in Gemini right now, and I'm going to ask to modularize, and I'm going to ask. We're not going to go crazy with the amount of tests. What I want to do is create a few tests, a little bit of validation, modularize, make that code a little bit better, and then take it from there so that we can have some…

Contents