Add another test to make sure that partial branch naming works

This commit is contained in:
Josh Dales
2021-08-07 15:20:20 -04:00
parent ee0e0eb513
commit a01b9aebb2
2 changed files with 15 additions and 1 deletions

View File

@@ -8,7 +8,6 @@ export const context = {
owner: "monalisa",
repo: "helloworld",
},
ref: "test/testing-time",
};
const mockApi = {

View File

@@ -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 {