Refactor integration test DecodeJSON calls to use generic return value (#37432)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: wxiaoguang <2114189+wxiaoguang@users.noreply.github.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
@@ -26,8 +26,7 @@ func TestAPIPullCommits(t *testing.T) {
|
||||
req := NewRequestf(t, http.MethodGet, "/api/v1/repos/%s/%s/pulls/%d/commits", repo.OwnerName, repo.Name, pr.Index)
|
||||
resp := MakeRequest(t, req, http.StatusOK)
|
||||
|
||||
var commits []*api.Commit
|
||||
DecodeJSON(t, resp, &commits)
|
||||
commits := DecodeJSON(t, resp, []*api.Commit{})
|
||||
|
||||
require.Len(t, commits, 2)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user