Skip to content

Commit

Permalink
Add mock API call for open PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
TimDuffy committed Oct 5, 2020
1 parent 5ea65bc commit af01bd4
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,28 @@ func TestRun(t *testing.T) {
"ref": "stalebranch",
"sha": "1761e021e70d29619ca270046b23bd243f652b98"
}
},
{
"number": 2,
"updated_at": "` + now.Format(time.RFC3339) + `",
"head": {
"ref": "notstalebranch",
"sha": "867530990210abcdefg867530990210abcdefg"
}
}
]`,
},
mockHTTPResponse{
method: "GET",
URL: "/repos/user/repo/pulls?state=open&sort=updated&direction=desc&per_page=100&page=1",
body: `[
{
"number": 2,
"updated_at": "` + now.Format(time.RFC3339) + `",
"head": {
"ref": "notstalebranch",
"sha": "867530990210abcdefg867530990210abcdefg"
}
}
]`,
},
Expand Down

0 comments on commit af01bd4

Please sign in to comment.