mirror of
https://github.com/actions/labeler.git
synced 2025-12-11 12:07:32 +00:00
Add tests for array branh labelling
This commit is contained in:
@@ -6,3 +6,6 @@ feature-branch:
|
|||||||
|
|
||||||
bug-branch:
|
bug-branch:
|
||||||
- branch: "{bug,fix}/*"
|
- branch: "{bug,fix}/*"
|
||||||
|
|
||||||
|
array-branch:
|
||||||
|
- branch: ["array/*", "*/array/*"]
|
||||||
|
|||||||
@@ -147,6 +147,20 @@ describe("run", () => {
|
|||||||
labels: ["bug-branch"],
|
labels: ["bug-branch"],
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("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"],
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
function usingLabelerConfigYaml(fixtureName: keyof typeof yamlFixtures): void {
|
function usingLabelerConfigYaml(fixtureName: keyof typeof yamlFixtures): void {
|
||||||
|
|||||||
Reference in New Issue
Block a user