forked from mirrors/probot
refactor: use Typescripts ReturnType<> instead of mocking all required properties
ping @JasonEtco - like that better?
This commit is contained in:
parent
796a118c9b
commit
bf5275d41f
|
@ -99,26 +99,9 @@ describe('Context', () => {
|
|||
let github: GitHubAPI
|
||||
|
||||
function responseFromString (content: string) {
|
||||
const data = {
|
||||
content: Buffer.from(content).toString('base64'),
|
||||
|
||||
// add dummy properties to make response compatible with Typecsript definitions
|
||||
_links: {
|
||||
git: '',
|
||||
html: '',
|
||||
self: ''
|
||||
},
|
||||
download_url: '',
|
||||
git_url: '',
|
||||
html_url: '',
|
||||
name: '',
|
||||
path: '',
|
||||
sha: '',
|
||||
size: 1,
|
||||
type: '',
|
||||
url: ''
|
||||
}
|
||||
return createMockResponse(data)
|
||||
return createMockResponse({
|
||||
content: Buffer.from(content).toString('base64')
|
||||
}) as ReturnType<typeof github.repos.getContents>
|
||||
}
|
||||
|
||||
function responseFromConfig (fileName: string) {
|
||||
|
|
Loading…
Reference in New Issue