Skip to content
Merged
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
15 changes: 15 additions & 0 deletions __tests__/bundle/blunderbussSettings.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,21 @@ describe('dist/index.js blunderbuss settings', () => {
expect(requested()).toEqual([['bob', 'carol']])
})

// src/utils/pullRequestOwners.ts:96 and blunderbuss.ts:165: assignees are read lowercased and never picked
it.each([
['one of the two reviewers is assigned, so the other is requested', ['Carol'], [['bob']]],
['both reviewers are assigned, so there is nobody to request', ['BOB', 'carol'], []],
])('an assignee is not a candidate: %s', async (_name, assignees, posts) => {
configure(` exclude_approvers: true\n`, { assignees: assignees.map(login => ({ login })) })

const result = await opened()

expect(requested()).toEqual(posts)
if (posts.length === 0) {
expect(result.stdout).toContain('blunderbuss: no reviewer candidates for #1')
}
})

it.each([
['one reviewer is already requested, so one more is picked', ['dave'], 1],
['two reviewers are already requested, so nobody is', ['dave', 'erin'], 0],
Expand Down
Loading