Files
labeler/__mocks__/@actions/github.ts
Mark Massoud 7a202e6428 fix: Limit number of labels added to 100 (#497)
* push to excess labels to avoid reaching the limit

* build dist

* never set more than 100 labels

* use splice instead of set

* ignore IDE folders

* install @octokit/plugin-retry

* always setLabels

* fix indentations

* fix specs

* add spec for excess labels

* prettier

* licensed cache

* revert to !!core.getInput('sync-labels')

* better warning for exceeded labels

* keep manually-added labels

* nest the dedupe logic

* rename `removeLabel` to `removeLabelFromList` to avoid confusion

* use Sets, and issue a call only if labels have actually changed

* remove IDE config folders from gitignore

* remove obsolete duplucation check

---------

Co-authored-by: Mark Massoud <mark@unrealcloud.io>
2023-06-21 11:49:43 +02:00

34 lines
544 B
TypeScript

export const context = {
payload: {
pull_request: {
number: 123
}
},
repo: {
owner: 'monalisa',
repo: 'helloworld'
}
};
const mockApi = {
rest: {
issues: {
setLabels: 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);