🧹 Add tests that run the whole action (#149)

This commit is contained in:
Patrick Ellis
2021-06-04 14:46:22 -04:00
committed by GitHub
parent b884ad6838
commit c9d0dfc82e
4 changed files with 151 additions and 1 deletions

View File

@@ -0,0 +1,32 @@
export const context = {
payload: {
pull_request: {
number: 123,
},
},
repo: {
owner: "monalisa",
repo: "helloworld",
},
};
const mockApi = {
issues: {
addLabels: jest.fn(),
removeLabel: jest.fn(),
},
paginate: jest.fn(),
pulls: {
get: jest.fn().mockResolvedValue({}),
listFiles: {
endpoint: {
merge: jest.fn().mockReturnValue({}),
},
},
},
repos: {
getContents: jest.fn(),
},
};
export const GitHub = jest.fn().mockImplementation(() => mockApi);