Skip to content
This repository was archived by the owner on Apr 17, 2025. It is now read-only.

Commit af01bd4

Browse files
committed
Add mock API call for open PRs
1 parent 5ea65bc commit af01bd4

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

Diff for: main_test.go

+22
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,28 @@ func TestRun(t *testing.T) {
208208
"ref": "stalebranch",
209209
"sha": "1761e021e70d29619ca270046b23bd243f652b98"
210210
}
211+
},
212+
{
213+
"number": 2,
214+
"updated_at": "` + now.Format(time.RFC3339) + `",
215+
"head": {
216+
"ref": "notstalebranch",
217+
"sha": "867530990210abcdefg867530990210abcdefg"
218+
}
219+
}
220+
]`,
221+
},
222+
mockHTTPResponse{
223+
method: "GET",
224+
URL: "/repos/user/repo/pulls?state=open&sort=updated&direction=desc&per_page=100&page=1",
225+
body: `[
226+
{
227+
"number": 2,
228+
"updated_at": "` + now.Format(time.RFC3339) + `",
229+
"head": {
230+
"ref": "notstalebranch",
231+
"sha": "867530990210abcdefg867530990210abcdefg"
232+
}
211233
}
212234
]`,
213235
},

0 commit comments

Comments
 (0)