1
0
mirror of https://github.com/actions/labeler synced 2026-05-05 11:17:48 +02:00
Files
labeler/__mocks__/@actions/github.ts
2021-08-07 15:12:02 -04:00

36 lines
613 B
TypeScript

export const context = {
payload: {
pull_request: {
number: 123,
},
},
repo: {
owner: "monalisa",
repo: "helloworld",
},
ref: "test/testing-time",
};
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);