Skip to content

Commit

Permalink
test($api-gitee-v5): get comments count from headers (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
meteorlxy committed Sep 6, 2019
1 parent b07d745 commit 68dcb2e
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions packages/@vssue/api-gitee-v5/__tests__/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -300,9 +300,6 @@ describe('methods', () => {
const issueId = 1

beforeEach(() => {
mock
.onGet(new RegExp(`repos/${options.owner}/${options.repo}/issues/${issueId}$`))
.reply(200, fixtures.issue)
mock
.onGet(new RegExp(`repos/${options.owner}/${options.repo}/issues/${issueId}/comments$`))
.reply(200, fixtures.comments, { 'total_count': fixtures.comments.length })
Expand All @@ -314,7 +311,7 @@ describe('methods', () => {
issueId,
accessToken: mockToken,
}) as VssueAPI.Comments
expect(mock.history.get.length).toBe(2)
expect(mock.history.get.length).toBe(1)

const request = mock.history.get[0]
expect(request.method).toBe('get')
Expand All @@ -330,7 +327,7 @@ describe('methods', () => {
issueId,
accessToken: null,
}) as VssueAPI.Comments
expect(mock.history.get.length).toBe(2)
expect(mock.history.get.length).toBe(1)

const request = mock.history.get[0]
expect(request.method).toBe('get')
Expand Down

0 comments on commit 68dcb2e

Please sign in to comment.