Files
labeler/__mocks__/@actions/github.ts
2023-01-28 17:57:52 -05:00

41 lines
684 B
TypeScript

export const context = {
payload: {
pull_request: {
number: 123,
head: {
ref: 'head-branch-name'
},
base: {
ref: 'base-branch-name'
}
}
},
repo: {
owner: 'monalisa',
repo: 'helloworld'
}
};
const mockApi = {
rest: {
issues: {
addLabels: jest.fn(),
removeLabel: jest.fn()
},
pulls: {
get: jest.fn().mockResolvedValue({}),
listFiles: {
endpoint: {
merge: jest.fn().mockReturnValue({})
}
}
},
repos: {
getContent: jest.fn()
}
},
paginate: jest.fn()
};
export const getOctokit = jest.fn().mockImplementation(() => mockApi);