I am aware that we can use Interfaces and mock database calls, but I decided to be replicate env so, you can create a new database for the tests alone. Remember we defined a test database in our. But that is not enough, we still need really test each of them to further proof. We have proven that then endpoints are working. ![]() Home(/) - Get Home page (No token required) Step 13: Writing Test Cases For Endpoints Next, initiate go modules which makes dependency version information explicit and easier to manage go mod init /) - An authenticated User deletes a post he created( Token required) This can be created anywhere on your computer. In case you just want to see the code, Get the source code for this article onĬreate the directory the project will live in. Where I built a Forum App using Gin Framework. I actually summed everything together in this article Consume the API endpoints using React/Vue.Host the API on AWS, Digital Ocean and/or Heroku.Integrate Travis, Coveralls, Code Climate, etc.There will be future articles that will explain how to: Table tests will also be used to test every possible case for a particular env.Īll methods and endpoints will be thoroughly tested. The API will be built in a way that you can decide to use Mysql or Postgres driver, simply by changing the configuration in the. You might be wondering seeing Postgres and Mysql. Gorilla Mux (For HTTP routing and URL matcher). ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |