diff --git a/__tests__/fixtures/branches.yml b/__tests__/fixtures/branches.yml index cdf9551d..b72c67f2 100644 --- a/__tests__/fixtures/branches.yml +++ b/__tests__/fixtures/branches.yml @@ -3,3 +3,6 @@ test-branch: feature-branch: - branch: "*/feature/*" + +bug-branch: + - branch: "{bug,fix}/*" diff --git a/__tests__/main.test.ts b/__tests__/main.test.ts index 1c61fc14..85e85f4c 100644 --- a/__tests__/main.test.ts +++ b/__tests__/main.test.ts @@ -133,6 +133,20 @@ describe("run", () => { labels: ["feature-branch"], }); }); + + it("it can support multiple branches by batching", async () => { + github.context.payload.pull_request!.head = { ref: "fix/123" }; + usingLabelerConfigYaml("branches.yml"); + await run(); + + expect(addLabelsMock).toHaveBeenCalledTimes(1); + expect(addLabelsMock).toHaveBeenCalledWith({ + owner: "monalisa", + repo: "helloworld", + issue_number: 123, + labels: ["bug-branch"], + }); + }); }); function usingLabelerConfigYaml(fixtureName: keyof typeof yamlFixtures): void {