From 3352df1f2b0ef052cea774a5eaff917ea700a1b4 Mon Sep 17 00:00:00 2001 From: Josh Dales Date: Wed, 17 May 2023 07:26:44 -0400 Subject: [PATCH] Bring test I accidently deleted --- __tests__/main.test.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/__tests__/main.test.ts b/__tests__/main.test.ts index 9efc87c9e..4dfe51120 100644 --- a/__tests__/main.test.ts +++ b/__tests__/main.test.ts @@ -168,6 +168,20 @@ describe('run', () => { }); }); + it('can support multiple branches by providing an array', async () => { + github.context.payload.pull_request!.head = {ref: 'array/123'}; + usingLabelerConfigYaml('branches.yml'); + await run(); + + expect(addLabelsMock).toHaveBeenCalledTimes(1); + expect(addLabelsMock).toHaveBeenCalledWith({ + owner: 'monalisa', + repo: 'helloworld', + issue_number: 123, + labels: ['array-branch'] + }); + }); + it('adds a label when matching any and all patterns are provided', async () => { usingLabelerConfigYaml('any_and_all.yml'); mockGitHubResponseChangedFiles('tests/test.ts');