test(tool/cmd/migrate): add test to fetchGoogleapisWithCommit#4550
test(tool/cmd/migrate): add test to fetchGoogleapisWithCommit#4550zhumin8 merged 2 commits intogoogleapis:mainfrom
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors fetchGoogleapisWithCommit to accept fetch.Endpoints as a parameter, which makes the function testable. A new test, TestFetchGoogleapisWithCommit, is added, effectively mocking the GitHub API using httptest. The changes are well-implemented, and the new test adheres to the project's testing guidelines. I have one suggestion to improve the maintainability of the new test by replacing a hardcoded repository path with the variable used in the implementation.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4550 +/- ##
==========================================
+ Coverage 79.65% 79.90% +0.24%
==========================================
Files 109 109
Lines 9126 9115 -11
==========================================
+ Hits 7269 7283 +14
+ Misses 1346 1322 -24
+ Partials 511 510 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Add test to fetchGoogleapisWithCommit. For #4514 (comment)