mirror of
https://github.com/actions/labeler.git
synced 2025-12-11 03:58:05 +00:00
Include a test for branching
This commit is contained in:
@@ -3,3 +3,6 @@ test-branch:
|
||||
|
||||
feature-branch:
|
||||
- branch: "*/feature/*"
|
||||
|
||||
bug-branch:
|
||||
- branch: "{bug,fix}/*"
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user