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",
|
||||
repo: "helloworld",
|
||||
},
|
||||
ref: "test/testing-time",
|
||||
};
|
||||
|
||||
const mockApi = {
|
||||
|
||||
@@ -105,6 +105,7 @@ describe("run", () => {
|
||||
});
|
||||
|
||||
it("adds labels based on the branch names that match the glob pattern", async () => {
|
||||
github.context.ref = "test/testing-time";
|
||||
usingLabelerConfigYaml("branches.yml");
|
||||
await run();
|
||||
|
||||
@@ -116,6 +117,20 @@ describe("run", () => {
|
||||
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 {
|
||||
|
||||
Reference in New Issue
Block a user