Hatena-Textbook 2018 学習日記(1) - $shibayu36->blog; の続きです。
今回は https://github.com/shibayu36/go-Intern-Diary/compare/ddef40c003464b410ea73cfd6787995c2484136f...01b1518eb0159b4a6d410188fd70ca1901a0e0ef あたりまで。とりあえず登録ページの作成と、登録に必要なservice層のメソッドを作りつつある。
- web/server_http_client_test.go の type httpClientや、web/server_test.goのnewAppServerみたいにテストユーティリティを作っておくと便利
- web層のテストは https://github.com/shibayu36/go-Intern-Diary/commit/cef0d7e690cd924ccb84c5a5d3e012f99abdb4d2 みたいにやるといい
- https://github.com/shibayu36/go-Intern-Diary/commit/baa36f13a27b8beb361c40754b246e687749a2c4 こういうのを作っておくと
docker-compose run --rm app make test TEST_ARGS='-run TestDiaryApp_CreateNewUser'
みたいなコマンドで特定のテストに絞って実行とか出来て便利