mirror of
https://github.com/actions/labeler.git
synced 2025-12-10 19:50:54 +00:00
35 lines
574 B
TypeScript
35 lines
574 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);
|