From 476fc87afd3e65828923d77731e6627cd79bc5f0 Mon Sep 17 00:00:00 2001 From: quality Date: Fri, 9 Oct 2026 01:04:31 -0400 Subject: [PATCH] test(bundle): drive blunderbuss's assignee exclusion (pullRequestOwners.ts:96) through dist/index.js A pull request's assignees are read lowercased and kept out of blunderbuss's reviewer candidates, but no bundle test ever served a pull request with assignees, so the mapping and the exclusion had no end-to-end hits. Add the case to blunderbussSettings.test.ts: one of two reviewers assigned under a mixed-case login leaves the other requested; both assigned leaves nobody. Closes #402 Signed-off-by: quality --- __tests__/bundle/blunderbussSettings.test.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/__tests__/bundle/blunderbussSettings.test.ts b/__tests__/bundle/blunderbussSettings.test.ts index 55b2d718..f400e0e0 100644 --- a/__tests__/bundle/blunderbussSettings.test.ts +++ b/__tests__/bundle/blunderbussSettings.test.ts @@ -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],