mirror of
https://github.com/actions/labeler.git
synced 2025-12-12 20:51:42 +00:00
35 lines
585 B
TypeScript
35 lines
585 B
TypeScript
export const context = {
|
|
payload: {
|
|
pull_request: {
|
|
number: 123,
|
|
},
|
|
},
|
|
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);
|