mirror of
https://github.com/actions/labeler.git
synced 2025-12-12 12:37:48 +00:00
Add another test to make sure that partial branch naming works
This commit is contained in:
@@ -8,7 +8,6 @@ export const context = {
|
|||||||
owner: "monalisa",
|
owner: "monalisa",
|
||||||
repo: "helloworld",
|
repo: "helloworld",
|
||||||
},
|
},
|
||||||
ref: "test/testing-time",
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const mockApi = {
|
const mockApi = {
|
||||||
|
|||||||
@@ -105,6 +105,7 @@ describe("run", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("adds labels based on the branch names that match the glob pattern", async () => {
|
it("adds labels based on the branch names that match the glob pattern", async () => {
|
||||||
|
github.context.ref = "test/testing-time";
|
||||||
usingLabelerConfigYaml("branches.yml");
|
usingLabelerConfigYaml("branches.yml");
|
||||||
await run();
|
await run();
|
||||||
|
|
||||||
@@ -116,6 +117,20 @@ describe("run", () => {
|
|||||||
labels: ["test-branch"],
|
labels: ["test-branch"],
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("adds labels based on branch names that match the glob pattern", async () => {
|
||||||
|
github.context.ref = "my/feature/that-i-like";
|
||||||
|
usingLabelerConfigYaml("branches.yml");
|
||||||
|
await run();
|
||||||
|
|
||||||
|
expect(addLabelsMock).toHaveBeenCalledTimes(1);
|
||||||
|
expect(addLabelsMock).toHaveBeenCalledWith({
|
||||||
|
owner: "monalisa",
|
||||||
|
repo: "helloworld",
|
||||||
|
issue_number: 123,
|
||||||
|
labels: ["feature-branch"],
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
function usingLabelerConfigYaml(fixtureName: keyof typeof yamlFixtures): void {
|
function usingLabelerConfigYaml(fixtureName: keyof typeof yamlFixtures): void {
|
||||||
|
|||||||
Reference in New Issue
Block a user