Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions __tests__/cronJobTest/labelPr.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe('cronLabelPr', () => {
// We can use any context here as "schedule" sends no webhook payload
// Instead, we use it to gain the repo owner and url
const context = new utils.mockContext(pullReqOpenedEvent)

nock(utils.api)
.get('/repos/Codertocat/Hello-World/pulls?page=1')
.reply(200, listPullReqs)
Expand Down Expand Up @@ -61,7 +61,7 @@ describe('cronLabelPr', () => {
// We can use any context here as "schedule" sends no webhook payload
// Instead, we use it to gain the repo owner and url
const context = new utils.mockContext(pullReqOpenedEvent)

nock(utils.api)
.get('/repos/Codertocat/Hello-World/pulls?page=1')
.reply(200, listPullReqs)
Expand Down Expand Up @@ -92,4 +92,4 @@ describe('cronLabelPr', () => {
})
expect(scope.isDone()).toBe(true)
})
})
})
1 change: 0 additions & 1 deletion __tests__/issueCommentTest/assign.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import issueListComments from '../fixtures/issues/assign/issueListComments.json'

nock.disableNetConnect()


describe('/assign', () => {
beforeEach(() => {
nock.cleanAll()
Expand Down
2 changes: 1 addition & 1 deletion __tests__/issueCommentTest/reopen.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe('/reopen', () => {
return true
})
.reply(200)

const commentContext = new utils.mockContext(issueCommentEvent)

await handleIssueComment(commentContext)
Expand Down
2 changes: 1 addition & 1 deletion __tests__/issueCommentTest/retitle.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe('/retitle', () => {
return true
})
.reply(200)

const commentContext = new utils.mockContext(issueCommentEvent)

await handleIssueComment(commentContext)
Expand Down
4 changes: 2 additions & 2 deletions __tests__/label/area.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe('area', () => {
return body
})
.reply(200)

nock(utils.api)
.get('/repos/Codertocat/Hello-World/contents/.github/labels.yaml')
.reply(200, labelFileContents)
Expand Down Expand Up @@ -82,4 +82,4 @@ describe('area', () => {
})
expect(scope.isDone()).toBe(true)
})
})
})
4 changes: 2 additions & 2 deletions __tests__/label/hold.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ describe('hold', () => {
nock(utils.api)
.delete('/repos/Codertocat/Hello-World/issues/1/labels/hold')
.reply(200)

nock(utils.api)
.get('/repos/Codertocat/Hello-World/issues/1')
.reply(200, issuePayload)

await handleIssueComment(commentContext)
expect(nock.isDone()).toBe(true)
})
})
})
4 changes: 2 additions & 2 deletions __tests__/label/kind.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe('kind', () => {
return body
})
.reply(200)

nock(utils.api)
.get('/repos/Codertocat/Hello-World/contents/.github/labels.yaml')
.reply(200, labelFileContents)
Expand Down Expand Up @@ -82,4 +82,4 @@ describe('kind', () => {
})
expect(scope.isDone()).toBe(true)
})
})
})
4 changes: 2 additions & 2 deletions __tests__/label/priority.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe('priority', () => {
return body
})
.reply(200)

nock(utils.api)
.get('/repos/Codertocat/Hello-World/contents/.github/labels.yaml')
.reply(200, labelFileContents)
Expand Down Expand Up @@ -82,4 +82,4 @@ describe('priority', () => {
})
expect(scope.isDone()).toBe(true)
})
})
})
7 changes: 3 additions & 4 deletions __tests__/label/remove.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe('remove', () => {
nock(utils.api)
.delete('/repos/Codertocat/Hello-World/issues/1/labels/some-label')
.reply(200)

nock(utils.api)
.get('/repos/Codertocat/Hello-World/issues/1')
.reply(200, issuePayload)
Expand All @@ -46,7 +46,7 @@ describe('remove', () => {
nock(utils.api)
.delete('/repos/Codertocat/Hello-World/issues/1/labels/some-other-label')
.reply(200)

nock(utils.api)
.get('/repos/Codertocat/Hello-World/issues/1')
.reply(200, issuePayload)
Expand All @@ -66,7 +66,7 @@ describe('remove', () => {
nock(utils.api)
.delete('/repos/Codertocat/Hello-World/issues/1/labels/some-label')
.reply(200)

nock(utils.api)
.get('/repos/Codertocat/Hello-World/issues/1')
.reply(200, issuePayload)
Expand All @@ -75,7 +75,6 @@ describe('remove', () => {
.get('/repos/Codertocat/Hello-World/collaborators/Codertocat')
.reply(404)


const spy = jest.spyOn(core, 'setFailed')
await handleIssueComment(commentContext)
expect(spy).toHaveBeenCalled()
Expand Down
2 changes: 1 addition & 1 deletion __tests__/utils/labeling.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ describe('utils labeling', () => {

issueCommentEvent.comment.body = '/area important'
const commentContext = new utils.mockContext(issueCommentEvent)

nock(utils.api)
.get('/repos/Codertocat/Hello-World/contents/.github/labels.yml')
.reply(200, malformedFileContents)
Expand Down